genirq: Make legacy autoprobing work again
authorThomas Gleixner <tglx@linutronix.de>
Tue, 30 Jan 2018 18:36:32 +0000 (19:36 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 1 Feb 2018 10:09:40 +0000 (11:09 +0100)
Meelis reported the following warning on a quad P3 HP NetServer museum piece:

WARNING: CPU: 3 PID: 258 at kernel/irq/chip.c:244 __irq_startup+0x80/0x100
EIP: __irq_startup+0x80/0x100
irq_startup+0x7e/0x170
probe_irq_on+0x128/0x2b0
parport_irq_probe.constprop.18+0x8d/0x1af [parport_pc]
parport_pc_probe_port+0xf11/0x1260 [parport_pc]
parport_pc_init+0x78a/0xf10 [parport_pc]
parport_parse_param.constprop.16+0xf0/0xf0 [parport_pc]
do_one_initcall+0x45/0x1e0

This is caused by the rewrite of the irq activation/startup sequence which
missed to convert a callsite in the irq legacy auto probing code.

To fix this irq_activate_and_startup() needs to gain a return value so the
pending logic can work proper.

Fixes: c942cee46bba ("genirq: Separate activation and startup")
Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Meelis Roos <mroos@linux.ee>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1801301935410.1797@nanos
kernel/irq/autoprobe.c
kernel/irq/chip.c
kernel/irq/internals.h

index 4e8089b319aedef183bef8e0131e0c5dafcb6d1b..8c82ea26e837d278dc133cc5fe24de06d565a7ed 100644 (file)
@@ -71,7 +71,7 @@ unsigned long probe_irq_on(void)
                raw_spin_lock_irq(&desc->lock);
                if (!desc->action && irq_settings_can_probe(desc)) {
                        desc->istate |= IRQS_AUTODETECT | IRQS_WAITING;
-                       if (irq_startup(desc, IRQ_NORESEND, IRQ_START_FORCE))
+                       if (irq_activate_and_startup(desc, IRQ_NORESEND))
                                desc->istate |= IRQS_PENDING;
                }
                raw_spin_unlock_irq(&desc->lock);
index 043bfc35b3534e45b9e4ec90c230000ea04519d1..c69357a43849e1650f347f916b499ba4da47c04b 100644 (file)
@@ -294,11 +294,11 @@ int irq_activate(struct irq_desc *desc)
        return 0;
 }
 
-void irq_activate_and_startup(struct irq_desc *desc, bool resend)
+int irq_activate_and_startup(struct irq_desc *desc, bool resend)
 {
        if (WARN_ON(irq_activate(desc)))
-               return;
-       irq_startup(desc, resend, IRQ_START_FORCE);
+               return 0;
+       return irq_startup(desc, resend, IRQ_START_FORCE);
 }
 
 static void __irq_disable(struct irq_desc *desc, bool mask);
index ab19371eab9b8e1e9a7789b882ed4a308883b555..ca6afa26707006faa59fff84b082f4dc96ec8294 100644 (file)
@@ -76,7 +76,7 @@ extern void __enable_irq(struct irq_desc *desc);
 #define IRQ_START_COND false
 
 extern int irq_activate(struct irq_desc *desc);
-extern void irq_activate_and_startup(struct irq_desc *desc, bool resend);
+extern int irq_activate_and_startup(struct irq_desc *desc, bool resend);
 extern int irq_startup(struct irq_desc *desc, bool resend, bool force);
 
 extern void irq_shutdown(struct irq_desc *desc);