netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Broadbent <markb@wetlettuce.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@oss.sgi.com
Subject: Re: [PATCH] Tulip interrupt uses non IRQ safe spinlock
Date: Mon, 02 May 2005 13:57:28 +0100	[thread overview]
Message-ID: <427623B8.8050107@wetlettuce.com> (raw)
In-Reply-To: <20050429224931.GA18616@gondor.apana.org.au>

Herbert Xu wrote:
> On Fri, Apr 29, 2005 at 09:35:21AM -0700, David S. Miller wrote:
> 
>>On i386 (or any other platform using the generic IRQ layer),
>>for example, unless you specify SA_INTERRUPT at
>>request_irq() time, the handler dispatch is:
>>
>>	local_irq_enable();
> 
> 
> Yes you're absolutely correct.
>  
> 
>>However, if you have multiple devices on that IRQ line, you
>>run into a problem.  Let's say TUlip interrupts first and
>>we go into the Tulip driver and grab the lock, next the other
>>device interrupts and we jump into the Tulip interrupt handler
>>again, we will deadlock but what we should have done is use
>>IRQ disabling spin locking like Mark's fix does.
> 
> 
> However, I don't see how this can happen.  __do_IRQ ensures
> that the handlers on a single IRQ aren't reentered by desc->lock
> and desc->status.  Softirqs are also kept out by irq_enter.  Am
> I missing something?

As far as I can see desc->lock is dropped before handle_IRQ_event() is
called in __do_IRQ() (kernel/irq/handle.c:170) and desc->status does not
prevent the execution of the IRQ handler.  Same with softirqs,
interrupts are enabled when the handler is called (kernel/softirq.c:89).

Thanks
Mark


>>Therefore I think his patch is perfectly fine and this is an
>>excellent area for an audit of the entire tree.  I even just
>>noticed recently that some of the Sparc drivers/serial/
>>drivers were not taking the interrupt handler lock correctly like
>>this (ie. using irqsave).
> 
> 
> Unless these drivers are registering two different IRQ lines that
> can nest within each other, I still think that a plain spin_lock is
> safe and desirable.
> 
> Cheers,

  reply	other threads:[~2005-05-02 12:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-28 20:42 [PATCH] Tulip interrupt uses non IRQ safe spinlock Mark Broadbent
2005-04-28 21:26 ` Herbert Xu
2005-04-29 16:35   ` David S. Miller
2005-04-29 17:43     ` Sergey Vlasov
2005-05-02 12:56       ` Mark Broadbent
2005-05-02 21:28         ` Herbert Xu
     [not found]           ` <57556.192.102.214.6.1115108726.squirrel@webmail.wetlettuce.com>
2005-05-03  9:07             ` Herbert Xu
2005-04-29 18:44     ` Francois Romieu
2005-04-29 22:49     ` Herbert Xu
2005-05-02 12:57       ` Mark Broadbent [this message]
2005-05-02 21:31         ` Herbert Xu
     [not found]         ` <20050502124358.7186447f.davem@davemloft.net>
2005-05-02 21:32           ` Herbert Xu
2005-05-02 21:32             ` David S. Miller
2005-05-02 21:45               ` Herbert Xu
2005-04-30  0:37 ` Alan Cox
2005-04-30  1:02   ` Herbert Xu
2005-05-02 14:16 ` Paulo Marques
2005-05-28  2:24 ` Jeff Garzik

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=427623B8.8050107@wetlettuce.com \
    --to=markb@wetlettuce.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).