Re: question in request_threaded_irq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Mon, Aug 15, 2011 at 7:03 PM, radhika bhaskaran <radhibhas@xxxxxxxxx> wrote:
Hi javier,

Thanks for the help.

I have tried the suggestion made by you. But unfortunately it did not work.

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.

The other isr funciton which is registered after the first isr is never executed.

Any more suggestions?

 
IRQ_SHARED flag could work if IRQ_ONESHOT isn't enabled.

In your request_threaded_irq(), you assigned thread_func() and NULL for handler_func(). It means that IRQ_ONESHOT is enabled. You either registered it to handler_func(), or abandon irq handler sharing between multiple drivers.



On Sun, Aug 14, 2011 at 6:31 AM, Javier Martinez Canillas <martinez.javier@xxxxxxxxx> wrote:
On Sat, Aug 13, 2011 at 9:25 PM, radhika bhaskaran <radhibhas@xxxxxxxxx> wrote:
> Hi,
> I have a question with respect to request_threaded_irq.
> Assume that one driver has registered and ISR on some particular irq number.
> Can i use the same irq number and register and isr in another driver.
> Because that is my requirement.
> when i try to do that is an error message with an error no as -19.
>  err = request_threaded_irq(pdata->irq , NULL, testing_fucntion,
>                             IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
> "testing_function", dev);
> Can some one please help me whether it is possible.
> Regards,
> RB

You have to use the IRQF_SHARED flag that specifies the IRQ will be
shared for two devices:

err = request_threaded_irq(pdata->irq , NULL, testing_fucntion, IRQF_SHARED |
                                     IRQF_TRIGGER_FALLING |
IRQF_TRIGGER_RISING,
                                     "testing_function", dev);

Have in mind that the kernel invokes every handler registered for that
IRQ every time an interrupt occurs on that line. So you have to check
in each ISR if the hardware raised the interrupt.

Hope it helps,

--
Javier Martínez Canillas
(+34) 682 39 81 69
Barcelona, Spain


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux