Subject: Re: netpoll + xmit_lock == deadlock

From: Neil Horman <[email-masked]>
Date: Wed, 29 Jul 2009 21:02:22 -0400

On Thu, Jul 30, 2009 at 07:17:35AM +0800, Herbert Xu wrote:
> On Wed, Jul 29, 2009 at 07:15:17PM -0400, Neil Horman wrote:
> >
> > Not quite.  I agree private locking in a driver is a pain when you consider
> > netpoll clients, its not the tx/tx recursion you need to worry about though, its
> > shared locking between the tx and rx path that you need to be worried about.
> > We should be protected against deadlock on the _xmit_lock from what we discussed
> > above, but if you take a lock in the driver, then call printk, its possible that
> > you'll go down the ->poll routine path in the driver.  If there you try to take
> > the same private lock, the result is then deadlock.
> 
> xmit_lock suffers from exactly the same problem in ->poll.
> 
Under what conditions do you try to take the xmit_lock from within a drivers
->poll routine?  Do you have an example?

Neil