netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* e100: Wait for PHY reset to complete?
@ 2006-10-25 17:22 Anders Grafstrom
  2006-10-25 18:56 ` Francois Romieu
  0 siblings, 1 reply; 10+ messages in thread
From: Anders Grafstrom @ 2006-10-25 17:22 UTC (permalink / raw)
  To: netdev

Shouldn't the e100 driver wait for PHY reset to complete before
proceeding in e100_set_settings()?

I'm asking because the interface (82551) sometimes ends up in loopback
when I try to set AUTONEG.

I'm thinking something like this patch.

Anders

--- linux-2.6.18.orig/drivers/net/e100.c	2006-09-20 05:42:06.000000000 +0200
+++ linux-2.6.18/drivers/net/e100.c	2006-10-17 17:43:47.000000000 +0200
@@ -2201,8 +2201,16 @@ static int e100_set_settings(struct net_
 {
 	struct nic *nic = netdev_priv(netdev);
 	int err;
+	int counter = 50;
 
 	mdio_write(netdev, nic->mii.phy_id, MII_BMCR, BMCR_RESET);
+
+	/* wait for possibly (ouch) 500ms */
+	while (mdio_read(netdev, nic->mii.phy_id, MII_BMCR) & BMCR_RESET) {
+		msleep(10);
+		if (!--counter) break;
+	}
+
 	err = mii_ethtool_sset(&nic->mii, cmd);
 	e100_exec_cb(nic, NULL, e100_configure);
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-10-31 18:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25 17:22 e100: Wait for PHY reset to complete? Anders Grafstrom
2006-10-25 18:56 ` Francois Romieu
2006-10-25 20:18   ` Auke Kok
2006-10-25 21:26     ` Auke Kok
2006-10-25 21:57       ` Francois Romieu
2006-10-25 23:36       ` Anders Grafström
2006-10-26  1:07         ` Auke Kok
2006-10-30 19:05           ` Auke Kok
2006-10-31 18:10             ` Anders Grafström
2006-10-31 18:34               ` Auke Kok

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).