[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1282593694.2378.230.camel@edumazet-laptop>
Date: Mon, 23 Aug 2010 22:01:34 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Neil Horman <nhorman@...driver.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] Fix deadlock between boomerang_interrupt and
boomerang_start_tx in 3c59x
Le mercredi 11 août 2010 à 11:12 -0400, Neil Horman a écrit :
> 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@...driver.com>
> ---
> drivers/net/3c59x.c | 15 ++++++++++++++-
> 1 files changed, 14 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
> index c754d88..c685a55 100644
> --- a/drivers/net/3c59x.c
> +++ b/drivers/net/3c59x.c
> @@ -633,7 +633,8 @@ struct vortex_private {
> open:1,
> medialock:1,
> must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */
> - large_frames:1; /* accept large frames */
> + large_frames:1, /* accept large frames */
> + handling_irq:1; /* private in_irq indicator */
It would be safer and faster to use a dedicated 'int' instead of a
bitfield.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists