when to use devm_request_irq and irq_set_chained_handler_and_data

Marc Zyngier marc.zyngier at arm.com
Wed Oct 7 08:43:54 PDT 2015


On 07/10/15 16:29, bharat kumar gogada wrote:
> when to use devm_request_irq and when to use irq_set_chained_handler_and_data.
> I see that some drivers are not using devm_request_irq instead using
> irq_set_chained_handler_and_data for setting up irq handling.

If you're writing code for a driver that is not consuming the interrupt
itself, but demultiplexing and forwarding it to another subsystem by
calling generic_handle_irq() (or something similar), then you must
implement a chained irqchip (as I mentioned yesterday while reviewing
your PCIe controler driver).

> If we use  irq_set_chained_handler_and_data will it show up in cat
> /proc/interrupts

No. Because this intermediate irqchip doesn't handle the interrupt, the
final handler is. Otherwise, you'd end up with twice the number of
interrupts...

	M.
-- 
Jazz is not dead. It just smells funny...



More information about the linux-arm-kernel mailing list