]> git.baikalelectronics.ru Git - kernel.git/commit
3c59x: Fix deadlock between boomerang_interrupt and boomerang_start_tx
authorNeil Horman <nhorman@tuxdriver.com>
Wed, 11 Aug 2010 05:12:57 +0000 (05:12 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Aug 2010 08:47:40 +0000 (01:47 -0700)
commit201111e46426d5227deefac07cb56dcccc2da997
tree86b4d306cea36eb547a88f59c2568a16b9bac700
parentf1cfba3aeeb9e33bbabd7b761382396143097251
3c59x: Fix deadlock between boomerang_interrupt and boomerang_start_tx

If netconsole is in use, there is a possibility for deadlock in 3c59x between
boomerang_interrupt and boomerang_start_xmit.  Both routines take the vp->lock,
and if netconsole is in use, a pr_* call from the boomerang_interrupt routine
will result in the netconsole code attempting to trnasmit an skb, which can try
to take the same spin lock, resulting in deadlock.

The fix is pretty straightforward.  This patch allocats a bit in the 3c59x
private structure to indicate that its handling an interrupt.  If we get into
the transmit routine and that bit is set, we can be sure that we have recursed
and will deadlock if we continue, so instead we just return NETDEV_TX_BUSY, so
the stack requeues the skb to try again later.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/3c59x.c