From: Jeff Mahoney <[EMAIL PROTECTED]>

Move the netif_carrier_off() call from tg3_init_one()->
tg3_init_link_config() to tg3_open() as is the convention for most other
network drivers.

I was getting a panic after a tg3 device failed to initialize due to DMA
failure.  The oops pointed to the link watch queue with spinlock debugging
enabled.  Without spinlock debugging, the Oops didn't occur.

I suspect that the link event was getting queued but not executed until
after the DMA test had failed and the device was freed.  The link event was
then operating on freed memory, which could contain anything.  With this
patch applied, the Oops no longer occurs.

Signed-off-by: Jeff Mahoney <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tg3.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN 
drivers/net/tg3.c~tg3-netif_carrier_off-runs-too-early-could-still-be-queued-when-init-fails
 drivers/net/tg3.c
--- 
devel/drivers/net/tg3.c~tg3-netif_carrier_off-runs-too-early-could-still-be-queued-when-init-fails
  2006-03-08 00:05:53.000000000 -0800
+++ devel-akpm/drivers/net/tg3.c        2006-03-08 00:05:53.000000000 -0800
@@ -6460,6 +6460,8 @@ static int tg3_open(struct net_device *d
        struct tg3 *tp = netdev_priv(dev);
        int err;
 
+       netif_carrier_off(tp->dev);
+
        tg3_full_lock(tp, 0);
 
        tg3_disable_ints(tp);
@@ -10456,7 +10458,6 @@ static void __devinit tg3_init_link_conf
        tp->link_config.speed = SPEED_INVALID;
        tp->link_config.duplex = DUPLEX_INVALID;
        tp->link_config.autoneg = AUTONEG_ENABLE;
-       netif_carrier_off(tp->dev);
        tp->link_config.active_speed = SPEED_INVALID;
        tp->link_config.active_duplex = DUPLEX_INVALID;
        tp->link_config.phy_is_low_power = 0;
_
-
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