From: Eric Dumazet <eric.dumazet@gmail.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Fix deadlock between boomerang_interrupt and boomerang_start_tx in 3c59x
Date: Mon, 23 Aug 2010 22:01:34 +0200 [thread overview]
Message-ID: <1282593694.2378.230.camel@edumazet-laptop> (raw)
In-Reply-To: <20100811151257.GB23317@hmsreliant.think-freely.org>
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@tuxdriver.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.
next prev parent reply other threads:[~2010-08-23 20:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-11 15:12 [PATCH] Fix deadlock between boomerang_interrupt and boomerang_start_tx in 3c59x Neil Horman
2010-08-11 16:09 ` Stephen Hemminger
2010-08-11 17:51 ` Neil Horman
2010-08-13 15:15 ` Herbert Xu
2010-08-23 20:01 ` Eric Dumazet [this message]
2010-08-23 20:24 ` Neil Horman
2010-08-23 20:48 ` Eric Dumazet
2010-08-23 23:41 ` Neil Horman
2010-08-24 8:48 ` David Miller
[not found] <1281538818-3915-1-git-send-email-nhorman@tuxdriver.com>
[not found] ` <20100811.231334.39172883.davem@davemloft.net>
2010-08-23 18:32 ` Neil Horman
2010-08-23 19:38 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1282593694.2378.230.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox