genirq: fix handle_nested_irq for lazy disable
When lazy disabling is implemented and an interrupt is disabled the
genirq code ends up marking it as IRQ_DISABLED in the descriptor.
The interrupt stays enabled in the controller. If the interrupt
fires after disabling, the flow handlers namely handle_level_irq and
handle_edge_irq mask the interrupt in the controller.
This is not the case with handle_nested_irq. The interrupt stays enabled in
the controller and if it were a level interrupt it keeps firing only to be
ignored by handle_nested_irq.
Update handle_nested_irq to mask such an interrupt.
CRs-Fixed: 300931
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Conflicts:
kernel/irq/chip.c
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index d5a3009..dc154f2 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -244,6 +244,7 @@
{
struct irq_desc *desc = irq_to_desc(irq);
struct irqaction *action;
+ int mask_this_irq = 0;
irqreturn_t action_ret;
might_sleep();
@@ -253,8 +254,10 @@
kstat_incr_irqs_this_cpu(irq, desc);
action = desc->action;
- if (unlikely(!action || irqd_irq_disabled(&desc->irq_data)))
+ if (unlikely(!action || irqd_irq_disabled(&desc->irq_data))) {
+ mask_this_irq = 1;
goto out_unlock;
+ }
irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS);
raw_spin_unlock_irq(&desc->lock);
@@ -268,6 +271,11 @@
out_unlock:
raw_spin_unlock_irq(&desc->lock);
+ if (unlikely(mask_this_irq)) {
+ chip_bus_lock(desc);
+ mask_irq(desc);
+ chip_bus_sync_unlock(desc);
+ }
}
EXPORT_SYMBOL_GPL(handle_nested_irq);