From: Trent Piepho <tpiepho@freescale.com>
To: netdev@vger.kernel.org
Cc: linuxppc-dev@ozlabs.org, Nate Case <ncase@xes-inc.com>,
Trent Piepho <tpiepho@freescale.com>
Subject: [PATCH 2/2] gianfar: Don't reset TBI<->SerDes link if it's already up
Date: Thu, 30 Oct 2008 18:17:07 -0700 [thread overview]
Message-ID: <1225415827-8167-2-git-send-email-tpiepho@freescale.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0810301738020.3943@t2.domain.actdsltmp>
The link may be up already via the chip's reset strapping, or though action
of U-Boot, or from the last time the interface was brought up. Resetting
the link causes it to go down for several seconds. This can significantly
increase the time from power-on to DHCP completion and a device being
accessible to the network.
Signed-off-by: Trent Piepho <tpiepho@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
---
drivers/net/gianfar.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 249541a..83a5cb6 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -591,6 +591,14 @@ static void gfar_configure_serdes(struct net_device *dev)
if (bus)
mutex_lock(&bus->mdio_lock);
+ /* If the link is already up, we must already be ok, and don't need to
+ * configure and reset the TBI<->SerDes link. Maybe U-Boot configured
+ * everything for us? Resetting it takes the link down and requires
+ * several seconds for it to come back.
+ */
+ if (gfar_local_mdio_read(regs, tbipa, MII_BMSR) & BMSR_LSTATUS)
+ goto done;
+
/* Single clk mode, mii mode off(for serdes communication) */
gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT);
@@ -601,6 +609,7 @@ static void gfar_configure_serdes(struct net_device *dev)
gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE |
BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000);
+ done:
if (bus)
mutex_unlock(&bus->mdio_lock);
}
--
1.5.4.1
next prev parent reply other threads:[~2008-10-31 1:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-28 22:53 [PATCH] gianfar: Omit TBI auto-negotiation based on device tree Nate Case
2008-10-31 1:07 ` Trent Piepho
2008-10-31 1:17 ` [PATCH 1/2] gianfar: Fix race in TBI/SerDes configuration Trent Piepho
2008-10-31 5:00 ` Jeff Garzik
2008-10-31 1:17 ` Trent Piepho [this message]
2008-11-03 18:55 ` [PATCH] gianfar: Omit TBI auto-negotiation based on device tree Nate Case
2008-11-03 20:38 ` Kumar Gala
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=1225415827-8167-2-git-send-email-tpiepho@freescale.com \
--to=tpiepho@freescale.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=ncase@xes-inc.com \
--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;
as well as URLs for NNTP newsgroup(s).