qcom_pas_attach() calls enable_irq() directly for subsystems already
running at kernel probe time, but never sets handover_irq_enabled.
This leaves the IRQ physically enabled with the tracking flag false.
On the first stop+restart cycle, qcom_q6v5_unprepare() consults
handover_irq_enabled, finds it false, and skips the disable_irq_nosync()
call—leaving the IRQ enabled. When qcom_q6v5_prepare() then calls
enable_irq() on the already-enabled IRQ (depth=0), the kernel emits:
WARNING: Unbalanced enable for IRQ 239
Fix by mirroring the enable_irq()/disable_irq() calls in qcom_pas_attach()
with matching handover_irq_enabled assignments, keeping the flag consistent
with actual hardware state.
Fixes: 16472c99f469 ("remoteproc: qcom: pas: Add late attach support for
subsystems")
Signed-off-by: Mukesh Ojha <[email protected]>
---
drivers/remoteproc/qcom_q6v5_pas.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c
b/drivers/remoteproc/qcom_q6v5_pas.c
index ca8e61254c44..25942200ba03 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -524,6 +524,7 @@ static int qcom_pas_attach(struct rproc *rproc)
int ret;
pas->q6v5.handover_issued = true;
+ pas->q6v5.handover_irq_enabled = true;
enable_irq(pas->q6v5.handover_irq);
pas->q6v5.running = true;
@@ -570,6 +571,7 @@ static int qcom_pas_attach(struct rproc *rproc)
pas->rproc->state = RPROC_OFFLINE;
ret = -EINVAL;
disable_running:
+ pas->q6v5.handover_irq_enabled = false;
disable_irq(pas->q6v5.handover_irq);
pas->q6v5.running = false;
--
2.55.0