linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 2.6.15: via-rhine + link loss + autoneg off == trouble
@ 2006-01-07 16:20 Denis Vlasenko
  2006-01-07 18:47 ` Lee Revell
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Vlasenko @ 2006-01-07 16:20 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2490 bytes --]

Hi,

2.6.15 still exhibits the via rhine "no tx" syndrome.

Again, the recipe:
* have via-rhine NIC
* unplug network cable
* reboot box
* force HDX (I do in with ethtool -s if autoneg off duplex half)
* plug cable back
* kernel still thinks that carrier is off despite "ethtool if"
  saying that link is detected.

Why:

...
        if (intr_status & IntrLinkChange)
                rhine_check_media(dev, 0);
...

static void rhine_check_media(struct net_device *dev, unsigned int init_media)
{
        struct rhine_private *rp = netdev_priv(dev);
        void __iomem *ioaddr = rp->base;

        mii_check_media(&rp->mii_if, debug, init_media);
...

unsigned int mii_check_media (struct mii_if_info *mii,
                              unsigned int ok_to_print,
                              unsigned int init_media)
{
        unsigned int old_carrier, new_carrier;
        int advertise, lpa, media, duplex;
        int lpa2 = 0;

        /* if forced media, go no further */
        if (mii->force_media)   <============================ HERE
                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);

        /* if carrier state did not change, this is a "bounce",
         * just exit as everything is already set correctly
         */
        if ((!init_media) && (old_carrier == new_carrier))
                return 0; /* duplex did not change */

        /* no carrier, nothing much to do */
        if (!new_carrier) {
                netif_carrier_off(mii->dev);
                if (ok_to_print)
                        printk(KERN_INFO "%s: link down\n", mii->dev->name);
                return 0; /* duplex did not change */
        }

        /*
         * we have carrier, see who's on the other end
         */
        netif_carrier_on(mii->dev);
...

We can never reach netif_carrier_on if mii->force_media is true!

> On Friday 11 November 2005 13:32, Jeff Garzik wrote:
> > As I've explained many times at this point, force_media means that link 
> > is always on, and mii_link_ok() should not be called.
> 
> Sorry, seems like I missed your mails...
>  
> > The only bug, it seems, is that the "if (mii->force_media)" branch 
> > should make sure to call netif_carrier_on()
> 
> Should also work.

Please find patch attached.
--
vda

[-- Attachment #2: linux-2.6.15.fix_no_tx_syndrome.diff --]
[-- Type: text/x-diff, Size: 465 bytes --]

--- linux-2.6.15.org/drivers/net/mii.c	Fri Dec 30 14:17:47 2005
+++ linux-2.6.15/drivers/net/mii.c	Sat Jan  7 18:15:27 2006
@@ -267,8 +267,10 @@ unsigned int mii_check_media (struct mii
 	int lpa2 = 0;
 
 	/* if forced media, go no further */
-	if (mii->force_media)
+	if (mii->force_media) {
+		netif_carrier_on(mii->dev);
 		return 0; /* duplex did not change */
+	}
 
 	/* check current and old link status */
 	old_carrier = netif_carrier_ok(mii->dev) ? 1 : 0;

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

* Re: [PATCH] 2.6.15: via-rhine + link loss + autoneg off == trouble
  2006-01-07 16:20 [PATCH] 2.6.15: via-rhine + link loss + autoneg off == trouble Denis Vlasenko
@ 2006-01-07 18:47 ` Lee Revell
  2006-01-07 21:04   ` Roger Luethi
  0 siblings, 1 reply; 5+ messages in thread
From: Lee Revell @ 2006-01-07 18:47 UTC (permalink / raw)
  To: Denis Vlasenko; +Cc: Jeff Garzik, linux-kernel

On Sat, 2006-01-07 at 18:20 +0200, Denis Vlasenko wrote:
> Hi,
> 
> 2.6.15 still exhibits the via rhine "no tx" syndrome.

Well you didn't cc: the via-rhine maintainer (Roger Luethi), no wonder
the patch didn't get picked up...

Lee


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

* Re: [PATCH] 2.6.15: via-rhine + link loss + autoneg off == trouble
  2006-01-07 18:47 ` Lee Revell
@ 2006-01-07 21:04   ` Roger Luethi
  2006-01-08 17:57     ` Denis Vlasenko
  0 siblings, 1 reply; 5+ messages in thread
From: Roger Luethi @ 2006-01-07 21:04 UTC (permalink / raw)
  To: Lee Revell; +Cc: Denis Vlasenko, Jeff Garzik, linux-kernel

On Sat, 07 Jan 2006 13:47:50 -0500, Lee Revell wrote:
> On Sat, 2006-01-07 at 18:20 +0200, Denis Vlasenko wrote:
> > Hi,
> > 
> > 2.6.15 still exhibits the via rhine "no tx" syndrome.
> 
> Well you didn't cc: the via-rhine maintainer (Roger Luethi), no wonder
> the patch didn't get picked up...

As long as you mention via-rhine, I am going to see it (thanks, procmail).
I don't remember seeing vda post a patch before. First he posted a problem
description, then an analysis (that I commented on), now a patch. Finally,
this is not a via-rhine problem. It's a problem in the mii code and
affects other drivers as well (those that use the generic mii code).

Roger

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

* Re: [PATCH] 2.6.15: via-rhine + link loss + autoneg off == trouble
  2006-01-07 21:04   ` Roger Luethi
@ 2006-01-08 17:57     ` Denis Vlasenko
  2006-01-08 18:03       ` Roger Luethi
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Vlasenko @ 2006-01-08 17:57 UTC (permalink / raw)
  To: Roger Luethi; +Cc: Lee Revell, Jeff Garzik, linux-kernel

On Saturday 07 January 2006 23:04, Roger Luethi wrote:
> On Sat, 07 Jan 2006 13:47:50 -0500, Lee Revell wrote:
> > On Sat, 2006-01-07 at 18:20 +0200, Denis Vlasenko wrote:
> > > Hi,
> > > 
> > > 2.6.15 still exhibits the via rhine "no tx" syndrome.
> > 
> > Well you didn't cc: the via-rhine maintainer (Roger Luethi), no wonder
> > the patch didn't get picked up...
 
> As long as you mention via-rhine, I am going to see it (thanks, procmail).
> I don't remember seeing vda post a patch before. First he posted a problem
> description, then an analysis (that I commented on), now a patch. Finally,

It's my second patch for this (really trivial) problem.
--
vda

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

* Re: [PATCH] 2.6.15: via-rhine + link loss + autoneg off == trouble
  2006-01-08 17:57     ` Denis Vlasenko
@ 2006-01-08 18:03       ` Roger Luethi
  0 siblings, 0 replies; 5+ messages in thread
From: Roger Luethi @ 2006-01-08 18:03 UTC (permalink / raw)
  To: Denis Vlasenko; +Cc: Lee Revell, Jeff Garzik, linux-kernel

On Sun, 08 Jan 2006 19:57:14 +0200, Denis Vlasenko wrote:
> On Saturday 07 January 2006 23:04, Roger Luethi wrote:
> > As long as you mention via-rhine, I am going to see it (thanks, procmail).
> > I don't remember seeing vda post a patch before. First he posted a problem
> > description, then an analysis (that I commented on), now a patch. Finally,
> 
> It's my second patch for this (really trivial) problem.

Duly noted :-). Sorry I missed it the first time around.

Roger

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

end of thread, other threads:[~2006-01-08 18:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-07 16:20 [PATCH] 2.6.15: via-rhine + link loss + autoneg off == trouble Denis Vlasenko
2006-01-07 18:47 ` Lee Revell
2006-01-07 21:04   ` Roger Luethi
2006-01-08 17:57     ` Denis Vlasenko
2006-01-08 18:03       ` Roger Luethi

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