* when to use devm_request_irq and irq_set_chained_handler_and_data
@ 2015-10-07 15:29 bharat kumar gogada
2015-10-07 15:43 ` Marc Zyngier
0 siblings, 1 reply; 4+ messages in thread
From: bharat kumar gogada @ 2015-10-07 15:29 UTC (permalink / raw)
To: linux-arm-kernel
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 we use irq_set_chained_handler_and_data will it show up in cat
/proc/interrupts
^ permalink raw reply [flat|nested] 4+ messages in thread
* when to use devm_request_irq and irq_set_chained_handler_and_data
2015-10-07 15:29 when to use devm_request_irq and irq_set_chained_handler_and_data bharat kumar gogada
@ 2015-10-07 15:43 ` Marc Zyngier
2015-10-07 16:07 ` Bharat Kumar Gogada
0 siblings, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2015-10-07 15:43 UTC (permalink / raw)
To: linux-arm-kernel
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...
^ permalink raw reply [flat|nested] 4+ messages in thread
* when to use devm_request_irq and irq_set_chained_handler_and_data
2015-10-07 15:43 ` Marc Zyngier
@ 2015-10-07 16:07 ` Bharat Kumar Gogada
2015-10-07 16:27 ` Marc Zyngier
0 siblings, 1 reply; 4+ messages in thread
From: Bharat Kumar Gogada @ 2015-10-07 16:07 UTC (permalink / raw)
To: linux-arm-kernel
Thanks, as mentioned in your review if have separate irq line which our driver consumes and we use devm_request_irq to setup irq line. Then can we use the same irq line number to setup chained irqchip but will there be two handlers for each of these or we can use the same handler.
> 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...
^ permalink raw reply [flat|nested] 4+ messages in thread
* when to use devm_request_irq and irq_set_chained_handler_and_data
2015-10-07 16:07 ` Bharat Kumar Gogada
@ 2015-10-07 16:27 ` Marc Zyngier
0 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2015-10-07 16:27 UTC (permalink / raw)
To: linux-arm-kernel
On 07/10/15 17:07, Bharat Kumar Gogada wrote:
> Thanks, as mentioned in your review if have separate irq line which
> our driver consumes and we use devm_request_irq to setup irq line.
> Then can we use the same irq line number to setup chained irqchip but
> will there be two handlers for each of these or we can use the same
> handler.
I'm not sure I understand what you mean here, but let me be clear about
what I want to see in your particular driver:
- if you handle MSIs, you need an MSI domain
- if you call generic_handle_irq(), your need a chained irqchip with its
own irq domain
None of the above cases can be implemented using devm_request_irq, or
request_irq, or setup_irq.
If you have interrupts that are directly consumed by your driver
(because they are interrupts that are unrelated to devices that are on
the PCIe bus), then you can possibly use devm_request_irq.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-07 16:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-07 15:29 when to use devm_request_irq and irq_set_chained_handler_and_data bharat kumar gogada
2015-10-07 15:43 ` Marc Zyngier
2015-10-07 16:07 ` Bharat Kumar Gogada
2015-10-07 16:27 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).