diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-09-11 07:59:27 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-09-12 03:38:53 -0400 |
commit | ed585a651681e822089087b426e6ebfb6d3d9873 (patch) | |
tree | d16e78437208dd660e05974506449c5260e479c5 /kernel/irq/chip.c | |
parent | d0a77454c70d0449a5f87087deb8f0cb15145e90 (diff) |
genirq: Make irq_shutdown() symmetric vs. irq_startup again
If an irq_chip provides .irq_shutdown(), but neither of .irq_disable() or
.irq_mask(), free_irq() crashes when jumping to NULL.
Fix this by only trying .irq_disable() and .irq_mask() if there's no
.irq_shutdown() provided.
This revives the symmetry with irq_startup(), which tries .irq_startup(),
.irq_enable(), and irq_unmask(), and makes it consistent with the comment for
irq_chip.irq_shutdown() in <linux/irq.h>, which says:
* @irq_shutdown: shut down the interrupt (defaults to ->disable if NULL)
This is also how __free_irq() behaved before the big overhaul, cfr. e.g.
3b56f0585fd4c02d047dc406668cb40159b2d340 ("genirq: Remove bogus conditional"),
where the core interrupt code always overrode .irq_shutdown() to
.irq_disable() if .irq_shutdown() was NULL.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Link: http://lkml.kernel.org/r/1315742394-16036-2-git-send-email-geert@linux-m68k.org
Cc: stable@kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/chip.c')
-rw-r--r-- | kernel/irq/chip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index d5a3009da71a..dc5114b4c16c 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -178,7 +178,7 @@ void irq_shutdown(struct irq_desc *desc) | |||
178 | desc->depth = 1; | 178 | desc->depth = 1; |
179 | if (desc->irq_data.chip->irq_shutdown) | 179 | if (desc->irq_data.chip->irq_shutdown) |
180 | desc->irq_data.chip->irq_shutdown(&desc->irq_data); | 180 | desc->irq_data.chip->irq_shutdown(&desc->irq_data); |
181 | if (desc->irq_data.chip->irq_disable) | 181 | else if (desc->irq_data.chip->irq_disable) |
182 | desc->irq_data.chip->irq_disable(&desc->irq_data); | 182 | desc->irq_data.chip->irq_disable(&desc->irq_data); |
183 | else | 183 | else |
184 | desc->irq_data.chip->irq_mask(&desc->irq_data); | 184 | desc->irq_data.chip->irq_mask(&desc->irq_data); |