Drivers using mii_check_media (via-rhine in particular) and also
forcing link parameters with ethtool can reach a state where the link
goes down and never comes back up.  This is because mii_check_media
short-circuits early if mii->force_media != 0.  This was discussed
in a couple of past threads, one of which is available here:

        http://www.ussg.iu.edu/hypermail/linux/kernel/0508.3/0670.html

The patch moves the force_media check to below the carrier status
check.  This allows the link state to show correctly, while avoiding
the check of link parameters.

Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---

 drivers/net/mii.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mii.c b/drivers/net/mii.c
index e42aa79..f919eb1 100644
--- a/drivers/net/mii.c
+++ b/drivers/net/mii.c
@@ -266,10 +266,6 @@ unsigned int mii_check_media (struct mii
        int advertise, lpa, media, duplex;
        int lpa2 = 0;
 
-       /* if forced media, go no further */
-       if (mii->force_media)
-               return 0; /* duplex did not change */
-
        /* check current and old link status */
        old_carrier = netif_carrier_ok(mii->dev) ? 1 : 0;
        new_carrier = (unsigned int) mii_link_ok(mii);
@@ -293,6 +289,13 @@ unsigned int mii_check_media (struct mii
         */
        netif_carrier_on(mii->dev);
 
+       /* if forced media, go no further */
+       if (mii->force_media) {
+               if (ok_to_print)
+                       printk(KERN_INFO "%s: link up\n", mii->dev->name);
+               return 0; /* duplex did not change */
+       }
+
        /* get MII advertise and LPA values */
        if ((!init_media) && (mii->advertising))
                advertise = mii->advertising;
-- 
John W. Linville
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to