* [net-2.6 PATCH] e100: e100_phy_init() isolates selected PHY, causes 10 second boot delay
@ 2009-10-29 23:42 Jeff Kirsher
2009-10-30 5:54 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Kirsher @ 2009-10-29 23:42 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Bernhard Kaindl, Bruce Allan, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
A change in how PHYs are electrically isolated caused all PHYs to be
isolated followed by reverting that isolation for the selected PHY.
Unfortunately, isolating the selected PHY for even a short period of
time can result in DHCP negotiation taking more than 10 seconds on certain
embedded configurations delaying boot time as reported by Bernhard Kaindl.
This patch reverts the change to how PHYs are isolated yet still works
around the issue for 82552 needing the selected PHY's BMCR register to
be written after the unused PHYs are isolated. This code is moved below
the setting of nic->phy ID in order to do the 82552-specific workaround.
Cc: Bernhard Kaindl <bernhard.kaindl@gmx.net>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e100.c | 26 +++++++++++++++++++-------
1 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 679965c..d19b084 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1426,19 +1426,31 @@ static int e100_phy_init(struct nic *nic)
} else
DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id);
- /* Isolate all the PHY ids */
- for (addr = 0; addr < 32; addr++)
- mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE);
- /* Select the discovered PHY */
- bmcr &= ~BMCR_ISOLATE;
- mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr);
-
/* Get phy ID */
id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1);
id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2);
nic->phy = (u32)id_hi << 16 | (u32)id_lo;
DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy);
+ /* Select the phy and isolate the rest */
+ for (addr = 0; addr < 32; addr++) {
+ if (addr != nic->mii.phy_id) {
+ mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE);
+ } else if (nic->phy != phy_82552_v) {
+ bmcr = mdio_read(netdev, addr, MII_BMCR);
+ mdio_write(netdev, addr, MII_BMCR,
+ bmcr & ~BMCR_ISOLATE);
+ }
+ }
+ /*
+ * Workaround for 82552:
+ * Clear the ISOLATE bit on selected phy_id last (mirrored on all
+ * other phy_id's) using bmcr value from addr discovery loop above.
+ */
+ if (nic->phy == phy_82552_v)
+ mdio_write(netdev, nic->mii.phy_id, MII_BMCR,
+ bmcr & ~BMCR_ISOLATE);
+
/* Handle National tx phys */
#define NCS_PHY_MODEL_MASK 0xFFF0FFFF
if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) {
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [net-2.6 PATCH] e100: e100_phy_init() isolates selected PHY, causes 10 second boot delay
2009-10-29 23:42 [net-2.6 PATCH] e100: e100_phy_init() isolates selected PHY, causes 10 second boot delay Jeff Kirsher
@ 2009-10-30 5:54 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-10-30 5:54 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bernhard.kaindl, bruce.w.allan
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 29 Oct 2009 16:42:41 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> A change in how PHYs are electrically isolated caused all PHYs to be
> isolated followed by reverting that isolation for the selected PHY.
> Unfortunately, isolating the selected PHY for even a short period of
> time can result in DHCP negotiation taking more than 10 seconds on certain
> embedded configurations delaying boot time as reported by Bernhard Kaindl.
> This patch reverts the change to how PHYs are isolated yet still works
> around the issue for 82552 needing the selected PHY's BMCR register to
> be written after the unused PHYs are isolated. This code is moved below
> the setting of nic->phy ID in order to do the 82552-specific workaround.
>
> Cc: Bernhard Kaindl <bernhard.kaindl@gmx.net>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-30 5:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29 23:42 [net-2.6 PATCH] e100: e100_phy_init() isolates selected PHY, causes 10 second boot delay Jeff Kirsher
2009-10-30 5:54 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox