soc: qcom: icc-bwmon: Allow for interrupts to be shared across instances
authorSibi Sankar <quic_sibis@quicinc.com>
Mon, 24 Jun 2024 09:22:13 +0000 (14:52 +0530)
committerBjorn Andersson <andersson@kernel.org>
Wed, 26 Jun 2024 04:22:43 +0000 (23:22 -0500)
commitdc18836435e7f8dda019db2c618c69194933157f
tree9bbd99ddff2b1f134a2172e8dd3d12893d47e30c
parent530c66142ec4871f71cf1d19e101426bd53e42dd
soc: qcom: icc-bwmon: Allow for interrupts to be shared across instances

The multiple BWMONv4 instances available on the X1E80100 SoC use the
same interrupt number. Mark them are shared to allow for re-use across
instances.

Using IRQF_SHARED coupled with devm_request_threaded_irq implies that
the irq can still trigger during/after bwmon_remove due to other active
bwmon instances. Handle this race by relying on bwmon_disable to disable
the interrupt and coupled with explicit request/free irqs.

Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240624092214.146935-4-quic_sibis@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/soc/qcom/icc-bwmon.c