irqchip/qcom-pdc: Fix broken locking
authorMarc Zyngier <maz@kernel.org>
Thu, 24 Feb 2022 10:12:25 +0000 (10:12 +0000)
committerMarc Zyngier <maz@kernel.org>
Mon, 28 Feb 2022 17:32:26 +0000 (17:32 +0000)
commitbd9fce2e5ea12ee82821dbc725fa4f97f9094ba1
treeb7e3d153e1e7feafbbf01506f0439cb1e8556354
parentaf5d5d1d9f2a4a81ae26cdf3eba30248a95f3c89
irqchip/qcom-pdc: Fix broken locking

pdc_enable_intr() serves as a primitive to qcom_pdc_gic_{en,dis}able,
and has a raw spinlock for mutual exclusion, which is uses with
interruptible primitives.

This means that this critical section can itself be interrupted.
Should the interrupt also be a PDC interrupt, and the endpoint driver
perform an irq_disable() on that interrupt, we end-up in a deadlock.

Fix this by using the irqsave/irqrestore variants of the locking
primitives.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220224101226.88373-5-maz@kernel.org
drivers/irqchip/qcom-pdc.c