netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anders Grafstrom <grfstrm@users.sourceforge.net>
To: netdev@vger.kernel.org
Subject: e100: Wait for PHY reset to complete?
Date: Wed, 25 Oct 2006 19:22:18 +0200	[thread overview]
Message-ID: <453F9D4A.8090306@users.sourceforge.net> (raw)

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

             reply	other threads:[~2006-10-25 17:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-25 17:22 Anders Grafstrom [this message]
2006-10-25 18:56 ` e100: Wait for PHY reset to complete? 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

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=453F9D4A.8090306@users.sourceforge.net \
    --to=grfstrm@users.sourceforge.net \
    --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).