Messages in this thread | | | Date | Thu, 14 Aug 2008 15:13:31 -0700 (PDT) | Subject | Re: [RFC][PATCH] netconsole: avoid deadlock on printk from driver code | From | David Miller <> |
| |
From: "Pekka Enberg" <penberg@cs.helsinki.fi> Date: Thu, 14 Aug 2008 16:28:37 +0300
> On Wed, Aug 13, 2008 at 1:37 PM, David Miller <davem@davemloft.net> wrote: > > 2) Do your locking differently so that the link status handling > > locking does not bisect the locking used for packet transmit > > in ->hard_start_xmit(). > > > > #2 is the reason why most other drivers don't have this silly > > bug, they don't hold TX path locks when handling link status > > and printing out such messages. > > Yeah, that works for the link status case, but not for things like the > printks in rtl8139_tx_interrupt()... Hmm.
Note that netconsole specifically does trylock on the netdev xmit lock specifically to handle this case.
If you could command the TX path solely under this generic lock already provided by the generic networking, you could avoid this deadlock as well.
This is yet another reason many other drivers don't get hit by this problem. The solution is built into netpoll but it only works if you use the provided generic locking mechanisms to mutex the driver's TX path.
| |