irqchip/qcom-pdc: Fix broken locking
authorMarc Zyngier <maz@kernel.org>
Thu, 24 Feb 2022 10:12:25 +0000 (10:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:55 +0000 (14:23 +0200)
commitdabfc878ef6f1b4597c9c0d719e6d7b919e64534
treef74b706cf456dcc331f90142a2460664732d7d24
parent05ba7d0c639fccbd9948d6ced168c5532379852b
irqchip/qcom-pdc: Fix broken locking

[ Upstream commit a6aca2f460e203781dc41391913cc5b54f4bc0ce ]

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>
Reviewed-by: Maulik Shah <quic_mkshah@quicinc.com>
Link: https://lore.kernel.org/r/20220224101226.88373-5-maz@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/irqchip/qcom-pdc.c