Skip to contentSkip to conversation

Interrupt handler registration for multiple devices

DISCUSSION Rick Brown 3 participants 3 messages Aug 30, 2006

lore
Share & tools
lore

Rick Brown

author
#0 lore raw

Hi,

I want to write a driver that will handle multiple devices. These devices will share the IRQ line. Do I need to register my (same) interrupt handler as many times as the number of devices(by calling request_irq())?

Also an unrelated query. Can I sleep after a call to preempt_kernel()??

TIA,

Rick
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#1 lore raw
Quoted 7 lines · Rick Brown

Hi,

I want to write a driver that will handle multiple devices. These devices will share the IRQ line. Do I need to register my (same) interrupt handler as many times as the number of devices(by calling request_irq())?

No, once will suffice. However, you will need to check your devices registers and figure out which device triggered the interrupt.

tavi
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#2 lore raw
In reply to Rick Brown

Ar Mer, 2006-08-30 am 20:42 +0530, ysgrifennodd Rick Brown:

Quoted 6 lines

Hi,

I want to write a driver that will handle multiple devices. These devices will share the IRQ line. Do I need to register my (same) interrupt handler as many times as the number of devices(by calling request_irq())?

Up to you. If you are working with standard devices that need no special handling to share interrupts (eg PCI bus), the device model makes it more natural to do that and let the kernel call your handler once for each device (passing a different dev_id).