mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@linux.intel.com>
To: "Barry K. Nathan" <barryn@pobox.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: [patch, -rc5-mm3] lock validator: fix ns83820.c irq-flags part 3
Date: Sun, 04 Jun 2006 12:08:27 +0200	[thread overview]
Message-ID: <1149415707.3109.96.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <986ed62e0606040253pfe9c300qf88029f88ae65039@mail.gmail.com>

On Sun, 2006-06-04 at 02:53 -0700, Barry K. Nathan wrote:
> On 6/4/06, Arjan van de Ven <arjan@linux.intel.com> wrote:
> > just the preempt the next email from Barry; while fixing this one I
> > looked at the usage of the locks more and found another patch needed...
> [snip]
> 
> Nice try, but it didn't work. ~_^
> 
> I was about to reply to the previous ns83820 patch with my dmesg, when
> I saw this one. I applied this patch too, and like the previous patch,
> it reports an instance of illegal lock usage. My dmesg follows.
> -- 


ok this is a real driver deadlock:

The ns83820 driver enabled interrupts (by unlocking the misc_lock with
_irq) while still holding the rx_info.lock, which is required to be irq
safe since it's used in the ISR like this:
                writel(1, dev->base + IER);
                spin_unlock_irq(&dev->misc_lock);
                kick_rx(ndev);
                spin_unlock_irq(&dev->rx_info.lock);

This is can cause a deadlock if an irq was pending at the first
spin_unlock_irq already, or if one would hit during kick_rx(). 
Simply remove the first _irq solves this

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>


---
 drivers/net/ns83820.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.17-rc5-mm3/drivers/net/ns83820.c
===================================================================
--- linux-2.6.17-rc5-mm3.orig/drivers/net/ns83820.c
+++ linux-2.6.17-rc5-mm3/drivers/net/ns83820.c
@@ -808,7 +808,7 @@ static int ns83820_setup_rx(struct net_d
 
 		writel(dev->IMR_cache, dev->base + IMR);
 		writel(1, dev->base + IER);
-		spin_unlock_irq(&dev->misc_lock);
+		spin_unlock(&dev->misc_lock);
 
 		kick_rx(ndev);
 


  reply	other threads:[~2006-06-04 10:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-04  8:30 [patch, -rc5-mm3] lock validator: fix ns83820.c irq-flags bug Ingo Molnar
2006-06-04  8:50 ` Keith Owens
2006-06-04  8:58   ` Ingo Molnar
     [not found] ` <1149411525.3109.73.camel@laptopd505.fenrus.org>
2006-06-04  9:53   ` [patch, -rc5-mm3] lock validator: fix ns83820.c irq-flags bug part 2 Barry K. Nathan
2006-06-04 10:08     ` Arjan van de Ven [this message]
2006-06-04 10:11       ` [patch, -rc5-mm3] lock validator: fix ns83820.c irq-flags part 3 Ingo Molnar
2006-06-04 10:16         ` Arjan van de Ven
2006-06-04 10:46       ` Barry K. Nathan
2006-06-04 11:02         ` Ingo Molnar

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=1149415707.3109.96.camel@laptopd505.fenrus.org \
    --to=arjan@linux.intel.com \
    --cc=akpm@osdl.org \
    --cc=barryn@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®