Skip to contentSkip to conversation

Defensive IRQ allocation procedure.

Xenomai-help Martin Shepherd 2 participants 2 messages May 4, 2009

lore
Share & tools
lore
#0 lore raw

Am I correct in believing that an RTDM driver can safely call request_irq() from its non-realtime ioctl_nr() callback? I want to do this to verify that a non-realtime driver isn't using the same IRQ as my realtime device, before I attempt to use it in my RTDM driver, and as well as to prevent any non-realtime drivers from allocating that IRQ once I have started to use it. I can't do this at module initialization time, because I don't know which of our identical digital I/O boards is connected to what, until I perform I/O to them, and not all of them need interrupts.

Thanks,

Martin

#1 lore raw
Quoted 9 lines · Martin Shepherd

Am I correct in believing that an RTDM driver can safely call request_irq() from its non-realtime ioctl_nr() callback? I want to do this to verify that a non-realtime driver isn't using the same IRQ as my realtime device, before I attempt to use it in my RTDM driver, and as well as to prevent any non-realtime drivers from allocating that IRQ once I have started to use it. I can't do this at module initialization time, because I don't know which of our identical digital I/O boards is connected to what, until I perform I/O to them, and not all of them need interrupts.

Yes, this should work. Note however, that request_irq will work even if there is another irq handler registered with IRQF_SHARED, and you pass IRQF_SHARED too.

Signature · 1 line
					    Gilles.