Messages in this thread | | | Date | Wed, 13 Aug 2008 03:56:28 -0700 (PDT) | Subject | Re: [RFC][PATCH] netconsole: avoid deadlock on printk from driver code | From | David Miller <> |
| |
From: "Vegard Nossum" <vegard.nossum@gmail.com> Date: Wed, 13 Aug 2008 12:44:46 +0200
> There must also be no BUG()s, WARN()s, other debugging facilities > (spinlock debugging, lockdep, irqtrace, etc.) triggering which may > call printk() inside the protected section. Can we really ensure this? > For all drivers supporting netconsole?
For all drivers supporting netconsole? Well yes, there will be some bugs somewhere in some driver wrt. netconsole. But that's life and why we will constantly have something to fix in the kernel isn't it?
But one thing is for sure, your deliriously dirty ->busy thing is emphatically not the answer.
BTW, it seems the main reason this driver is susceptible to this problem is that it doesn't handle link status events in it's NAPI poll handler. If it did that, you would have never seen this deadlock.
The netpoll layer prevents recursion into the NAPI ->poll() handler.
Most drivers manage link state either in their NAPI ->poll() handler or a periodic timer that samples the link state. Both schemes avoid this very issue.
| |