Skip to content

Commit da3f875

Browse files
Lina IyerMarc Zyngier
authored andcommitted
irqchip/qcom-pdc: Do not toggle IRQ_ENABLE during mask/unmask
When an interrupt is to be serviced, the convention is to mask the interrupt at the chip and unmask after servicing the interrupt. Enabling and disabling the interrupt at the PDC irqchip causes an interrupt storm due to the way dual edge interrupts are handled in hardware. Skip configuring the PDC when the IRQ is masked and unmasked, instead use the irq_enable/irq_disable callbacks to toggle the IRQ_ENABLE register at the PDC. The PDC's IRQ_ENABLE register is only used during the monitoring mode when the system is asleep and is not needed for active mode detection. Signed-off-by: Lina Iyer <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b2bb01e commit da3f875

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

drivers/irqchip/qcom-pdc.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,25 @@ static void pdc_enable_intr(struct irq_data *d, bool on)
6363
raw_spin_unlock(&pdc_lock);
6464
}
6565

66-
static void qcom_pdc_gic_mask(struct irq_data *d)
66+
static void qcom_pdc_gic_disable(struct irq_data *d)
6767
{
6868
pdc_enable_intr(d, false);
69+
irq_chip_disable_parent(d);
70+
}
71+
72+
static void qcom_pdc_gic_enable(struct irq_data *d)
73+
{
74+
pdc_enable_intr(d, true);
75+
irq_chip_enable_parent(d);
76+
}
77+
78+
static void qcom_pdc_gic_mask(struct irq_data *d)
79+
{
6980
irq_chip_mask_parent(d);
7081
}
7182

7283
static void qcom_pdc_gic_unmask(struct irq_data *d)
7384
{
74-
pdc_enable_intr(d, true);
7585
irq_chip_unmask_parent(d);
7686
}
7787

@@ -148,6 +158,8 @@ static struct irq_chip qcom_pdc_gic_chip = {
148158
.irq_eoi = irq_chip_eoi_parent,
149159
.irq_mask = qcom_pdc_gic_mask,
150160
.irq_unmask = qcom_pdc_gic_unmask,
161+
.irq_disable = qcom_pdc_gic_disable,
162+
.irq_enable = qcom_pdc_gic_enable,
151163
.irq_retrigger = irq_chip_retrigger_hierarchy,
152164
.irq_set_type = qcom_pdc_gic_set_type,
153165
.flags = IRQCHIP_MASK_ON_SUSPEND |

0 commit comments

Comments
 (0)