All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: akpm@osdl.org, arjan@linux.intel.com
Cc: netdev@vger.kernel.org, mingo@elte.hu, bcrl@kvack.org
Subject: Re: [patch 7/8] lock validator: fix ns83820.c irq-flags bug
Date: Sun, 11 Jun 2006 10:55:42 -0400	[thread overview]
Message-ID: <448C2EEE.1020405@garzik.org> (raw)
In-Reply-To: <200606090519.k595JmDG032032@shell0.pdx.osdl.net>

akpm@osdl.org wrote:
> From: Ingo Molnar <mingo@elte.hu>
> 
> Barry K. Nathan reported the following lockdep warning:
> 
> [  197.343948] BUG: warning at kernel/lockdep.c:1856/trace_hardirqs_on()
> [  197.345928]  [<c010329b>] show_trace_log_lvl+0x5b/0x105
> [  197.346359]  [<c0103896>] show_trace+0x1b/0x20
> [  197.346759]  [<c01038ed>] dump_stack+0x1f/0x24
> [  197.347159]  [<c012efa2>] trace_hardirqs_on+0xfb/0x185
> [  197.348873]  [<c029b009>] _spin_unlock_irq+0x24/0x2d
> [  197.350620]  [<e09034e8>] do_tx_done+0x171/0x179 [ns83820]
> [  197.350895]  [<e090445c>] ns83820_irq+0x149/0x20b [ns83820]
> [  197.351166]  [<c013b4b8>] handle_IRQ_event+0x1d/0x52
> [  197.353216]  [<c013c6c2>] handle_level_irq+0x97/0xe1
> [  197.355157]  [<c01048c3>] do_IRQ+0x8b/0xac
> [  197.355612]  [<c0102d9d>] common_interrupt+0x25/0x2c

The driver's locking is definitely wrong, but I don't think this is the 
fix, because PCI drivers with a single interrupt should be using 
spin_lock() in the interrupt handler.  Anything more would be uncivilized :)

/me starts to do a better patch...

Jesus, the locking here is awful.  No wonder there are bugs.

Since this driver isn't seeing a ton of work these days, I think the 
best thing to do would be to _simplify_ the locking.  This driver is 
grabbing so many locks, turning interrupts off+on so often that any 
benefit the multiple locks had is probably long gone, particularly on 
modern machines.

Let me see what I can do with it...

	Jeff



       reply	other threads:[~2006-06-11 14:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200606090519.k595JmDG032032@shell0.pdx.osdl.net>
2006-06-11 14:55 ` Jeff Garzik [this message]
2006-06-11 15:00   ` [patch 7/8] lock validator: fix ns83820.c irq-flags bug Arjan van de Ven
2006-06-11 16:09     ` Jeff Garzik
2006-06-11 16:12       ` Arjan van de Ven
2006-06-11 17:01 ` Jeff Garzik
2006-06-11 17:02   ` Arjan van de Ven
2006-06-11 20:28   ` Benjamin LaHaise

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=448C2EEE.1020405@garzik.org \
    --to=jeff@garzik.org \
    --cc=akpm@osdl.org \
    --cc=arjan@linux.intel.com \
    --cc=bcrl@kvack.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.