The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: David Jander <david.jander@protonic.nl>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Why does handle_simple_irq() require IRQ's to be disabled?
Date: Tue, 7 Jun 2011 09:05:00 +0200	[thread overview]
Message-ID: <20110607090500.4f060390@archvile> (raw)
In-Reply-To: <alpine.LFD.2.02.1106061816280.13964@ionos>


Hi Thomas,

On Mon, 6 Jun 2011 18:18:41 +0200 (CEST)
Thomas Gleixner <tglx@linutronix.de> wrote:

> On Mon, 6 Jun 2011, David Jander wrote:
> > 
> > Hi,
> > 
> > I am trying to implement/fix interrupt controller functionality in
> > gpio/pca953x.c, and for some reason which I don't understand, I need to
> > disable interrupts with local_irq_disable() before calling
> > generic_handle_irq(). This does not seem right.
> > If I follow the code of handle_simple_irq(), the handler function setup for
> > this IRQ, I get to handle_irq_event_percpu(), which has a
> > WARN_ONCE(!irqs_disabled(),...
> > This WARN is triggered, since nobody explicitly disables interrupts. Why?
> >  
> > generic_hanlde_irq() is called from a threaded interrupt handler of the
> > parent of this interrupt controller, and calling local_irq_disable() here
> > seems like a crime. What am I doing wrong?
> 
> handle_nested_irq() is your friend.

Thanks! This worked without disabling IRQ's.
One last question, though:

I set up the handler using irq_set_chip_and_handler(irq, ...,
handle_simple_irq);
>From the interrupt thread, I call handle_nested_irq(). Is it OK, that in this
case, the defined handler function (handle_simple_irq) is not used? Does this
still make sense? Wouldn't calling just irq_set_chip() be enough here (it
seems to work correctly)?

Best regards,

-- 
David Jander
Protonic Holland.

  reply	other threads:[~2011-06-07  7:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06 15:28 Why does handle_simple_irq() require IRQ's to be disabled? David Jander
2011-06-06 16:18 ` Thomas Gleixner
2011-06-07  7:05   ` David Jander [this message]
2011-06-07  8:26     ` Thomas Gleixner
2011-06-07  8:55       ` David Jander

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=20110607090500.4f060390@archvile \
    --to=david.jander@protonic.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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