mbox series

[v2,0/7] Provide and use generic_handle_irq_safe() where appropriate.

Message ID 20220131123404.175438-1-bigeasy@linutronix.de
Headers show
Series Provide and use generic_handle_irq_safe() where appropriate. | expand

Message

Sebastian Andrzej Siewior Jan. 31, 2022, 12:33 p.m. UTC
generic_handle_irq() must be used from primary IRQ-handler (chain
handler/ interrupt controller entry). It is low level code and the
function expects that interrupts are disabled at entry point.

This isn't the case for invocations from tasklets, workqueues or the
primary interrupt handler on PREEMPT_RT. Once this gets noticed a
"local_irq_disable|safe()" is added. To avoid further confusion this
series adds generic_handle_irq_safe() which can be used from any context
and adds a few user.

v2…v1:
 - Redo kernel-doc for generic_handle_irq_safe() in #1.
 - Use generic_handle_irq_safe() instead of generic_handle_irq() in the
   patch description where I accidently used the wrong one.

v1:
   https://lore.kernel.org/all/20220127113303.3012207-1-bigeasy@linutronix.de/

Sebastian

Comments

Greg Kroah-Hartman Jan. 31, 2022, 12:54 p.m. UTC | #1
On Mon, Jan 31, 2022 at 01:34:04PM +0100, Sebastian Andrzej Siewior wrote:
> Instead of manually disabling interrupts before invoking use
> generic_handle_irq_safe() which can be invoked with enabled and disabled
> interrupts.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold Feb. 1, 2022, 9:45 a.m. UTC | #2
On Mon, Jan 31, 2022 at 01:34:04PM +0100, Sebastian Andrzej Siewior wrote:
> Instead of manually disabling interrupts before invoking use
> generic_handle_irq_safe() which can be invoked with enabled and disabled
> interrupts.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Acked-by: Johan Hovold <johan@kernel.org>