mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Graziadei <thomas.graziadei@omicronenergy.com>
To: <claudiu.manoil@freescale.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: Thomas Graziadei <thomas.graziadei@omicronenergy.com>
Subject: [PATCH 2/2] gianfar: Use the same initial values as the phy layer
Date: Mon, 13 Feb 2017 13:22:09 +0100	[thread overview]
Message-ID: <1486988529-24924-2-git-send-email-thomas.graziadei@omicronenergy.com> (raw)
In-Reply-To: <1486988529-24924-1-git-send-email-thomas.graziadei@omicronenergy.com>

From: Thomas Graziadei <thomas.graziadei@omicronenergy.com>

The phy layer sets the link status initially to 1 to also support phyless
systems, therefore we set the gianfar drivers initial link status also to
1. This prevents the gfar_update_link_state() method to be called when the
driver and phy have just been initialized but no link state change was
detected yet.

Signed-off-by: Thomas Graziadei <thomas.graziadei@omicronenergy.com>
---
 drivers/net/ethernet/freescale/gianfar.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index b3b5c43..be0d23e 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -1705,7 +1705,7 @@ static int gfar_restore(struct device *dev)
 
 	gfar_start(priv);
 
-	priv->oldlink = 0;
+	priv->oldlink = 1;
 	priv->oldspeed = 0;
 	priv->oldduplex = -1;
 
@@ -1791,7 +1791,7 @@ static int init_phy(struct net_device *dev)
 	phy_interface_t interface;
 	struct phy_device *phydev;
 
-	priv->oldlink = 0;
+	priv->oldlink = 1;
 	priv->oldspeed = 0;
 	priv->oldduplex = -1;
 
@@ -2212,7 +2212,7 @@ int startup_gfar(struct net_device *ndev)
 	gfar_start(priv);
 
 	/* force link state update after mac reset */
-	priv->oldlink = 0;
+	priv->oldlink = 1;
 	priv->oldspeed = 0;
 	priv->oldduplex = -1;
 
-- 
2.7.4

  reply	other threads:[~2017-02-13 13:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 12:22 [PATCH 1/2] gianfar: Deal with link state changes during GFAR_RESETTING dev state Thomas Graziadei
2017-02-13 12:22 ` Thomas Graziadei [this message]
2017-02-13 17:10 ` Claudiu Manoil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486988529-24924-2-git-send-email-thomas.graziadei@omicronenergy.com \
    --to=thomas.graziadei@omicronenergy.com \
    --cc=claudiu.manoil@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®