diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2018-01-30 13:36:32 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-02-01 05:09:40 -0500 |
commit | 1beaeacdc88b537703d04d5536235d0bbb36db93 (patch) | |
tree | 3a1e0d79526c7ee3d84f7cbdd3a340079be5a290 | |
parent | 8de50dc26278a05363781514beb092a366c84654 (diff) |
genirq: Make legacy autoprobing work again
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
-rw-r--r-- | kernel/irq/autoprobe.c | 2 | ||||
-rw-r--r-- | kernel/irq/chip.c | 6 | ||||
-rw-r--r-- | kernel/irq/internals.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/kernel/irq/autoprobe.c b/kernel/irq/autoprobe.c index 4e8089b319ae..8c82ea26e837 100644 --- a/kernel/irq/autoprobe.c +++ b/kernel/irq/autoprobe.c | |||
@@ -71,7 +71,7 @@ unsigned long probe_irq_on(void) | |||
71 | raw_spin_lock_irq(&desc->lock); | 71 | raw_spin_lock_irq(&desc->lock); |
72 | if (!desc->action && irq_settings_can_probe(desc)) { | 72 | if (!desc->action && irq_settings_can_probe(desc)) { |
73 | desc->istate |= IRQS_AUTODETECT | IRQS_WAITING; | 73 | desc->istate |= IRQS_AUTODETECT | IRQS_WAITING; |
74 | if (irq_startup(desc, IRQ_NORESEND, IRQ_START_FORCE)) | 74 | if (irq_activate_and_startup(desc, IRQ_NORESEND)) |
75 | desc->istate |= IRQS_PENDING; | 75 | desc->istate |= IRQS_PENDING; |
76 | } | 76 | } |
77 | raw_spin_unlock_irq(&desc->lock); | 77 | raw_spin_unlock_irq(&desc->lock); |
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 043bfc35b353..c69357a43849 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -294,11 +294,11 @@ int irq_activate(struct irq_desc *desc) | |||
294 | return 0; | 294 | return 0; |
295 | } | 295 | } |
296 | 296 | ||
297 | void irq_activate_and_startup(struct irq_desc *desc, bool resend) | 297 | int irq_activate_and_startup(struct irq_desc *desc, bool resend) |
298 | { | 298 | { |
299 | if (WARN_ON(irq_activate(desc))) | 299 | if (WARN_ON(irq_activate(desc))) |
300 | return; | 300 | return 0; |
301 | irq_startup(desc, resend, IRQ_START_FORCE); | 301 | return irq_startup(desc, resend, IRQ_START_FORCE); |
302 | } | 302 | } |
303 | 303 | ||
304 | static void __irq_disable(struct irq_desc *desc, bool mask); | 304 | static void __irq_disable(struct irq_desc *desc, bool mask); |
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index ab19371eab9b..ca6afa267070 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h | |||
@@ -76,7 +76,7 @@ extern void __enable_irq(struct irq_desc *desc); | |||
76 | #define IRQ_START_COND false | 76 | #define IRQ_START_COND false |
77 | 77 | ||
78 | extern int irq_activate(struct irq_desc *desc); | 78 | extern int irq_activate(struct irq_desc *desc); |
79 | extern void irq_activate_and_startup(struct irq_desc *desc, bool resend); | 79 | extern int irq_activate_and_startup(struct irq_desc *desc, bool resend); |
80 | extern int irq_startup(struct irq_desc *desc, bool resend, bool force); | 80 | extern int irq_startup(struct irq_desc *desc, bool resend, bool force); |
81 | 81 | ||
82 | extern void irq_shutdown(struct irq_desc *desc); | 82 | extern void irq_shutdown(struct irq_desc *desc); |