diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-02-18 12:25:17 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-02-19 04:43:58 -0500 |
commit | 89d694b9dbe769ca1004e01db0ca43964806a611 (patch) | |
tree | b8fd51348034a4b09547ea0137d4ac467f6987fa | |
parent | 188fd89d539d899bfca2bc83534e5508e0161139 (diff) |
genirq: do not leave interupts enabled on free_irq
The default_disable() function was changed in commit:
76d2160147f43f982dfe881404cfde9fd0a9da21
genirq: do not mask interrupts by default
It removed the mask function in favour of the default delayed
interrupt disabling. Unfortunately this also broke the shutdown in
free_irq() when the last handler is removed from the interrupt for
those architectures which rely on the default implementations. Now we
can end up with a enabled interrupt line after the last handler was
removed, which can result in spurious interrupts.
Fix this by adding a default_shutdown function, which is only
installed, when the irqchip implementation does provide neither a
shutdown nor a disable function.
[@stable: affected versions: .21 - .24 ]
Pointed-out-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: stable@kernel.org
Tested-by: Michael Hennerich <Michael.Hennerich@analog.com>
-rw-r--r-- | kernel/irq/chip.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index cc54c6276356..fdb3fbe2b0c4 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -246,6 +246,17 @@ static unsigned int default_startup(unsigned int irq) | |||
246 | } | 246 | } |
247 | 247 | ||
248 | /* | 248 | /* |
249 | * default shutdown function | ||
250 | */ | ||
251 | static void default_shutdown(unsigned int irq) | ||
252 | { | ||
253 | struct irq_desc *desc = irq_desc + irq; | ||
254 | |||
255 | desc->chip->mask(irq); | ||
256 | desc->status |= IRQ_MASKED; | ||
257 | } | ||
258 | |||
259 | /* | ||
249 | * Fixup enable/disable function pointers | 260 | * Fixup enable/disable function pointers |
250 | */ | 261 | */ |
251 | void irq_chip_set_defaults(struct irq_chip *chip) | 262 | void irq_chip_set_defaults(struct irq_chip *chip) |
@@ -256,8 +267,15 @@ void irq_chip_set_defaults(struct irq_chip *chip) | |||
256 | chip->disable = default_disable; | 267 | chip->disable = default_disable; |
257 | if (!chip->startup) | 268 | if (!chip->startup) |
258 | chip->startup = default_startup; | 269 | chip->startup = default_startup; |
270 | /* | ||
271 | * We use chip->disable, when the user provided its own. When | ||
272 | * we have default_disable set for chip->disable, then we need | ||
273 | * to use default_shutdown, otherwise the irq line is not | ||
274 | * disabled on free_irq(): | ||
275 | */ | ||
259 | if (!chip->shutdown) | 276 | if (!chip->shutdown) |
260 | chip->shutdown = chip->disable; | 277 | chip->shutdown = chip->disable != default_disable ? |
278 | chip->disable : default_shutdown; | ||
261 | if (!chip->name) | 279 | if (!chip->name) |
262 | chip->name = chip->typename; | 280 | chip->name = chip->typename; |
263 | if (!chip->end) | 281 | if (!chip->end) |