Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdf5d1bd authored by Lina Iyer's avatar Lina Iyer
Browse files

driver: irqchip: 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.

Change-Id: Ibfa7b3eac4a9bba472004de039018da5624629dc
Signed-off-by: default avatarLina Iyer <ilina@codeaurora.org>
parent 0da1adc5
Loading
Loading
Loading
Loading
+20 −2
Original line number Original line Diff line number Diff line
@@ -67,12 +67,29 @@ static void pdc_enable_intr(struct irq_data *d, bool on)
	raw_spin_unlock(&pdc_lock);
	raw_spin_unlock(&pdc_lock);
}
}


static void qcom_pdc_gic_mask(struct irq_data *d)
static void qcom_pdc_gic_disable(struct irq_data *d)
{
{
	if (d->hwirq == GPIO_NO_WAKE_IRQ)
	if (d->hwirq == GPIO_NO_WAKE_IRQ)
		return;
		return;


	pdc_enable_intr(d, false);
	pdc_enable_intr(d, false);
	irq_chip_disable_parent(d);
}

static void qcom_pdc_gic_enable(struct irq_data *d)
{
	if (d->hwirq == GPIO_NO_WAKE_IRQ)
		return;

	pdc_enable_intr(d, true);
	irq_chip_enable_parent(d);
}

static void qcom_pdc_gic_mask(struct irq_data *d)
{
	if (d->hwirq == GPIO_NO_WAKE_IRQ)
		return;

	irq_chip_mask_parent(d);
	irq_chip_mask_parent(d);
}
}


@@ -81,7 +98,6 @@ static void qcom_pdc_gic_unmask(struct irq_data *d)
	if (d->hwirq == GPIO_NO_WAKE_IRQ)
	if (d->hwirq == GPIO_NO_WAKE_IRQ)
		return;
		return;


	pdc_enable_intr(d, true);
	irq_chip_unmask_parent(d);
	irq_chip_unmask_parent(d);
}
}


@@ -194,6 +210,8 @@ static struct irq_chip qcom_pdc_gic_chip = {
	.irq_eoi		= irq_chip_eoi_parent,
	.irq_eoi		= irq_chip_eoi_parent,
	.irq_mask		= qcom_pdc_gic_mask,
	.irq_mask		= qcom_pdc_gic_mask,
	.irq_unmask		= qcom_pdc_gic_unmask,
	.irq_unmask		= qcom_pdc_gic_unmask,
	.irq_disable		= qcom_pdc_gic_disable,
	.irq_enable		= qcom_pdc_gic_enable,
	.irq_retrigger		= irq_chip_retrigger_hierarchy,
	.irq_retrigger		= irq_chip_retrigger_hierarchy,
	.irq_set_type		= qcom_pdc_gic_set_type,
	.irq_set_type		= qcom_pdc_gic_set_type,
	.flags			= IRQCHIP_MASK_ON_SUSPEND |
	.flags			= IRQCHIP_MASK_ON_SUSPEND |