Skip to content

Commit 792ea6a

Browse files
l1kKAGA-KOKO
authored andcommitted
genirq: Remove WARN_ON_ONCE() in generic_handle_domain_irq()
Since commit 0953fb2 ("irq: remove handle_domain_{irq,nmi}()"), generic_handle_domain_irq() warns if called outside hardirq context, even though the function calls down to handle_irq_desc(), which warns about the same, but conditionally on handle_enforce_irqctx(). The newly added warning is a false positive if the interrupt originates from any other irqchip than x86 APIC or ARM GIC/GICv3. Those are the only ones for which handle_enforce_irqctx() returns true. Per commit c16816a ("genirq: Add protection against unsafe usage of generic_handle_irq()"): "In general calling generic_handle_irq() with interrupts disabled from non interrupt context is harmless. For some interrupt controllers like the x86 trainwrecks this is outright dangerous as it might corrupt state if an interrupt affinity change is pending." Examples for interrupt chips where the warning is a false positive are USB-attached GPIO controllers such as drivers/gpio/gpio-dln2.c: USB gadgets are incapable of directly signaling an interrupt because they cannot initiate a bus transaction by themselves. All communication on the bus is initiated by the host controller, which polls a gadget's Interrupt Endpoint in regular intervals. If an interrupt is pending, that information is passed up the stack in softirq context, from which a hardirq is synthesized via generic_handle_domain_irq(). Remove the warning to eliminate such false positives. Fixes: 0953fb2 ("irq: remove handle_domain_{irq,nmi}()") Signed-off-by: Lukas Wunner <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Jakub Kicinski <[email protected]> CC: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: Octavian Purdila <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/c3caf60bfa78e5fdbdf483096b7174da65d1813a.1652168866.git.lukas@wunner.de
1 parent c5eb0a6 commit 792ea6a

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

kernel/irq/irqdesc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,6 @@ EXPORT_SYMBOL_GPL(generic_handle_irq_safe);
701701
*/
702702
int generic_handle_domain_irq(struct irq_domain *domain, unsigned int hwirq)
703703
{
704-
WARN_ON_ONCE(!in_hardirq());
705704
return handle_irq_desc(irq_resolve_mapping(domain, hwirq));
706705
}
707706
EXPORT_SYMBOL_GPL(generic_handle_domain_irq);

0 commit comments

Comments
 (0)