question in request_threaded_irq

Javier Martinez Canillas martinez.javier at gmail.com
Mon Aug 15 11:10:02 EDT 2011


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





More information about the Kernelnewbies mailing list