Subject: Re: [PATCH] Prevent netpoll hanging when link is down

From: Matt Mackall <[email-masked]>
Date: Mon, 11 Oct 2004 11:22:24 -0500

On Mon, Oct 11, 2004 at 05:40:00PM +0200, Andi Kleen wrote:
> On Sun, Oct 10, 2004 at 08:59:28PM -0700, David S. Miller wrote:
> > 
> > Wait, I think I see the problem.
> > 
> > Sungem processes link status in it's ->poll() NAPI handler.
> > This occurs via calls to gem_pcs_interrupt(), for example.
> > Non-pcs sungem variants use a timer to poll link status.
> > 
> > When the link changes state, this link state processing
> > does printk()'s.
> > 
> > So perhaps that is why it deadlocks.
> 
> printk handles recursion with the down_trylock on console_sem.
> So it shouldn't deadlock.

If we're in the ->poll() handler for non-netpoll reasons, and the link
state changes, causing a printk, we'll potentially reenter ->poll() via
netconsole.

This also explains the original fix quite nicely. Colin, can you try
commenting out all the printks in gem_pcs_interrupt and if that works,
we'll start thinking about a proper fix.

-- 
Mathematics is the supreme nostalgia of our time.