genirq: Handle pending irqs in irq_startup()
An interrupt might be pending when irq_startup() is called, but the startup code does not invoke the resend logic. In some cases this prevents the device from issuing another interrupt which renders the device non functional. Call the resend function in irq_startup() to keep things going. Reported-and-tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Cc: stable@vger.kernel.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
@ -157,19 +157,22 @@ static void irq_state_set_masked(struct irq_desc *desc)
|
||||
irqd_set(&desc->irq_data, IRQD_IRQ_MASKED);
|
||||
}
|
||||
|
||||
int irq_startup(struct irq_desc *desc)
|
||||
int irq_startup(struct irq_desc *desc, bool resend)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
irq_state_clr_disabled(desc);
|
||||
desc->depth = 0;
|
||||
|
||||
if (desc->irq_data.chip->irq_startup) {
|
||||
int ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
|
||||
ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
|
||||
irq_state_clr_masked(desc);
|
||||
return ret;
|
||||
} else {
|
||||
irq_enable(desc);
|
||||
}
|
||||
|
||||
irq_enable(desc);
|
||||
return 0;
|
||||
if (resend)
|
||||
check_irq_resend(desc, desc->irq_data.irq);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void irq_shutdown(struct irq_desc *desc)
|
||||
@ -646,7 +649,7 @@ __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
|
||||
irq_settings_set_noprobe(desc);
|
||||
irq_settings_set_norequest(desc);
|
||||
irq_settings_set_nothread(desc);
|
||||
irq_startup(desc);
|
||||
irq_startup(desc, true);
|
||||
}
|
||||
out:
|
||||
irq_put_desc_busunlock(desc, flags);
|
||||
|
Reference in New Issue
Block a user