Commit 605cb392 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Luis Henriques

genirq: Prevent resend to interrupts marked IRQ_NESTED_THREAD

commit 75a06189 upstream.

The resend mechanism happily calls the interrupt handler of interrupts
which are marked IRQ_NESTED_THREAD from softirq context. This can
result in crashes because the interrupt handler is not the proper way
to invoke the device handlers. They must be invoked via
handle_nested_irq.

Prevent the resend even if the interrupt has no valid parent irq
set. Its better to have a lost interrupt than a crashing machine.
Reported-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent fd6139cf
...@@ -75,13 +75,21 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq) ...@@ -75,13 +75,21 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq)
!desc->irq_data.chip->irq_retrigger(&desc->irq_data)) { !desc->irq_data.chip->irq_retrigger(&desc->irq_data)) {
#ifdef CONFIG_HARDIRQS_SW_RESEND #ifdef CONFIG_HARDIRQS_SW_RESEND
/* /*
* If the interrupt has a parent irq and runs * If the interrupt is running in the thread
* in the thread context of the parent irq, * context of the parent irq we need to be
* retrigger the parent. * careful, because we cannot trigger it
* directly.
*/ */
if (desc->parent_irq && if (irq_settings_is_nested_thread(desc)) {
irq_settings_is_nested_thread(desc)) /*
* If the parent_irq is valid, we
* retrigger the parent, otherwise we
* do nothing.
*/
if (!desc->parent_irq)
return;
irq = desc->parent_irq; irq = desc->parent_irq;
}
/* Set it pending and activate the softirq: */ /* Set it pending and activate the softirq: */
set_bit(irq, irqs_resend); set_bit(irq, irqs_resend);
tasklet_schedule(&resend_tasklet); tasklet_schedule(&resend_tasklet);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment