Re: possibly bug in 8139cp? (WAS Re: BUG: 2.4.23-pre3 + ifconfig)

From: Andrew Morton
Date: Mon Sep 08 2003 - 15:51:20 EST


Jeff Garzik <jgarzik@xxxxxxxxx> wrote:
>
> On Mon, Sep 08, 2003 at 09:43:25AM -0700, Fedor Karpelevitch wrote:
> > > > > I just installed 2.4.23-pre3 on one of our servers. If I
> > > > > up/down the loopback device multiple times ifconfig hangs on
> > > > > the second down (as in unkillable) and afterwards ifconfig
> > > > > stops functioning and I can't reboot the machine, etc.
>
> This sounds like the NAPI bug we're chasing.
>

Well it's the same as the bug which was recently added to 2.6:

- dev_close() used to do

test_bit(__LINK_STATE_RX_SCHED, &dev->state);

- the netif_poll_disable() in tg3.c used to do

test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state);

- someone copied the tg3 netif_poll_disable() into netdevice.h and then
used it in dev_close(), thus changing and presumably breaking
dev_close().


I haven't tested this yet, but it'll probably fix things for all NICs and
it might break tg3. In which case it's a net win ;)


diff -puN include/linux/netdevice.h~ifdown-lockup-fix include/linux/netdevice.h
--- 25/include/linux/netdevice.h~ifdown-lockup-fix Mon Sep 8 13:20:28 2003
+++ 25-akpm/include/linux/netdevice.h Mon Sep 8 13:20:34 2003
@@ -854,7 +854,7 @@ static inline void netif_rx_complete(str

static inline void netif_poll_disable(struct net_device *dev)
{
- while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) {
+ while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) {
/* No hurry. */
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(1);

_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/