All of lore.kernel.org
 help / color / mirror / Atom feed
From: martinez.javier@gmail.com (Javier Martinez Canillas)
To: kernelnewbies@lists.kernelnewbies.org
Subject: question in request_threaded_irq
Date: Mon, 15 Aug 2011 17:10:02 +0200	[thread overview]
Message-ID: <1313421002.3908.7.camel@sauron> (raw)
In-Reply-To: <CACSty9hFksoSX-gPzQ4mOASwzoTK+LBLwDJYn5v1o-6X8UD4ZQ@mail.gmail.com>

On Mon, 2011-08-15 at 16:33 +0530, radhika bhaskaran wrote:

> 
> For my debugging purpose i tried to register two isr's on the same
> number IRQ no in  the same driver. But the isr which is registerd
> first is being hit.
> 

Since the kernel is monolithic is doesn't really matter where your ISR
functions are defined and where these handlers are assigned an IRQ line.

> 
> The other isr funciton which is registered after the first isr is
> never executed.
> 
> 
> Any more suggestions?
> 

Yes, does yours ISR function handlers look if they generated the interrupt and 
if not respond accordingly?
If your device didn't raised the interrupt then they have to return IRQ_NONE. 
If your hardware raised the interrupt then you have to do the processing and 
return IRQ_HANDLED.

So you have to do something like this:

static irqreturn_t my_interrupt(int irq, void *data)
{
        int result;
        struct my_device *my_dev = data;

        result = check_interrupt_raised(my_dev);

        if (!result)
           return IRQ_NONE;

	process_interrupt(my_dev);
        return IRQ_HANDLED;
}

Hope it helps,
Javier Martinez Canillas

  reply	other threads:[~2011-08-15 15:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-13 19:25 question in request_threaded_irq radhika bhaskaran
2011-08-14  1:01 ` Javier Martinez Canillas
2011-08-15 11:03   ` radhika bhaskaran
2011-08-15 15:10     ` Javier Martinez Canillas [this message]
2011-08-23  5:26     ` Haojian Zhuang

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=1313421002.3908.7.camel@sauron \
    --to=martinez.javier@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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.