| To: | "David S. Miller" <davem@xxxxxxxxxx> |
|---|---|
| Subject: | Re: Bug#251215: kernel-image-2.6.6-1-k7: pppd locks up, cannot be killed, during ppp shutdown |
| From: | Stephen Hemminger <shemminger@xxxxxxxx> |
| Date: | Tue, 1 Jun 2004 09:13:53 -0700 |
| Cc: | Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>, debian.bugs@xxxxxxxxxxxxxxxx, 251215@xxxxxxxxxxxxxxx, jgarzik@xxxxxxxxx, netdev@xxxxxxxxxxx |
| In-reply-to: | <20040529124833.5eca66d7.davem@xxxxxxxxxx> |
| Organization: | Open Source Development Lab |
| References: | <E1BTLVa-000Ezb-FC@xxxxxxxxxxxxxxxxxxxxxxxx> <20040528124355.GA2391@xxxxxxxxxxxxxxxxxxx> <40B744DC.9956BF50@xxxxxxxxxxxxxxxx> <20040529051736.GA11303@xxxxxxxxxxxxxxxxxxx> <20040529124833.5eca66d7.davem@xxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
On Sat, 29 May 2004 12:48:33 -0700
"David S. Miller" <davem@xxxxxxxxxx> wrote:
> On Sat, 29 May 2004 15:17:36 +1000
> Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
>
> > 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?
>
> Because the driver is the only agent which knows when it is safe
> to free up the structure. It may still have some attached memory
> to free, for example, ala:
>
> unregister_netdev(dev);
> kfree(dev->priv);
> free_netdev(dev);
>
> This is common, for example in drivers/net/tg3.c:tg3_remove_one() we
> have:
>
> struct tg3 *tp = netdev_priv(dev);
>
> unregister_netdev(dev);
> iounmap((void *)tp->regs);
> free_netdev(dev);
>
Also, for those device that don't want to do anything in between:
dev->destructor = free_netdev;
Will end up calling free_netdev in the run_todo processing. This
can be very handy when unregister needs to happen in some context
already called with RTNL.
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 14/17 linux-2.6.7-rc2] prism54: Reduce module verbosity, Margit Schubert-While |
|---|---|
| Next by Date: | [3c59x] Add support for ATI Radeon 9100 IGP, Bogdan Costescu |
| Previous by Thread: | [PATCH 14/17 linux-2.6.7-rc2] prism54: Reduce module verbosity, Margit Schubert-While |
| Next by Thread: | [3c59x] Add support for ATI Radeon 9100 IGP, Bogdan Costescu |
| Indexes: | [Date] [Thread] [Top] [All Lists] |