]> bbs.cooldavid.org Git - net-next-2.6.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)
commitaa25ab7d943a5e1e6bcc2a65ff6669144f5b5d60
tree86b4d306cea36eb547a88f59c2568a16b9bac700
parentbf82791ed667758a0f18a4b76be2d931d2c1b39d
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