All of lore.kernel.org
 help / color / mirror / Atom feed
* Threaded irq handler question
@ 2010-04-21 16:35 Will Newton
  2010-04-21 17:28 ` Jonathan Corbet
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Will Newton @ 2010-04-21 16:35 UTC (permalink / raw)
  To: Linux Kernel list; +Cc: Thomas Gleixner

Hi all,

I have a threaded irq handler attached to a level-triggered gpio
interrupt line. The check handler checks the status of the gpio line
and disables the irq line amd returns WAKE_THREAD in that case:

static irqreturn_t isr_check(int irq, void *p)
{
        if (gpio_status()) {
                disable_irq_nosync(irq);
                return IRQ_WAKE_THREAD;
        }

        return IRQ_NONE;
}

The thread then does some i2c transactions that will eventually
deassert the gpio line:

static irqreturn_t isr(int irq, void *p)
{
        /* do some i2c transfers */
        enable_irq(irq);
        return IRQ_HANDLED;
}

My problem is that this structure does not work, because once I call
disable_irq_nosync() on the irq in the check handler the thread will
no longer run because the irq is disabled. However if I don't call
disable_irq_nosync() I will get endless irqs because the line is
level-triggered and will not be deasserted until the thread has run.

Could someone tell me what I'm doing wrong here?

Thanks,

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-23 13:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21 16:35 Threaded irq handler question Will Newton
2010-04-21 17:28 ` Jonathan Corbet
2010-04-22 10:51   ` Will Newton
2010-04-22  1:37 ` Yong Zhang
2010-04-22 10:51   ` Will Newton
2010-04-23 13:30     ` Mark Brown
2010-04-23 13:29 ` Mark Brown

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.