netdev
[Top] [All Lists]

Re: Bug#251215: kernel-image-2.6.6-1-k7: pppd locks up, cannot be kille

To: herbert@xxxxxxxxxxxxxxxxxxx (Herbert Xu)
Subject: Re: Bug#251215: kernel-image-2.6.6-1-k7: pppd locks up, cannot be killed, during ppp shutdown
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 29 May 2004 22:00:52 +1000
Cc: debian.bugs@xxxxxxxxxxxxxxxx, 251215@xxxxxxxxxxxxxxx, shemminger@xxxxxxxx, davem@xxxxxxxxxx, jgarzik@xxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20040529051736.GA11303@xxxxxxxxxxxxxxxxxxx>
Organization: Core
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.25-1-686-smp (i686))
Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> OK, I've had a look and it looks like the free_netdev call in
> ppp_shutdown_inteface is the problem.  What's happening is that
> the todo list is being processed either on another CPU or by
> preemption in another context.  As a result when the subsequent
> free_netdev is called the device hasn't yet been processed and
> is still in state UNREGISTERING.
> 
> Why do we need to call free_netdev after unregistering the netdev
> from the drivers at all? What's wrong with calling it from run_todo
> itself?

Well I guess someone might want to reregister the net device :)

Here is a minimal fix for this problem.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email:  Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
===== net/core/dev.c 1.141 vs edited =====
--- 1.141/net/core/dev.c        2004-05-23 06:45:55 +10:00
+++ edited/net/core/dev.c       2004-05-29 21:56:18 +10:00
@@ -2999,7 +2999,6 @@
 
                case NETREG_UNREGISTERING:
                        netdev_unregister_sysfs(dev);
-                       dev->reg_state = NETREG_UNREGISTERED;
 
                        netdev_wait_allrefs(dev);
 
@@ -3015,6 +3014,7 @@
                         */
                        if (dev->destructor)
                                dev->destructor(dev);
+                       class_device_put(&dev->class_dev);
                        break;
 
                default:
@@ -3140,6 +3140,8 @@
        free_divert_blk(dev);
 
        /* Finish processing unregister after unlock */
+       dev->reg_state = NETREG_UNREGISTERED;
+       class_device_get(&dev->class_dev);
        net_set_todo(dev);
 
        dev_put(dev);

<Prev in Thread] Current Thread [Next in Thread>