soc: qcom: rpmh-rsc: reclaim the TCS to avoid spurious irq in Linux

If we don't reclaim and clear the IRQ bits, we might get a spurious
interrupt from this TCS in Linux:
WARNING: CPU: 0 PID: 0 at drivers/soc/qcom/rpmh-rsc.c:451 tcs_tx_done+0x98/0x270
...
 Call trace:
  tcs_tx_done+0x98/0x270 (P)
  __handle_irq_event_percpu+0x60/0x220
  handle_irq_event+0x54/0xc0
  handle_fasteoi_irq+0xa8/0x1c0
  handle_irq_desc+0x3c/0x68
  generic_handle_domain_irq+0x24/0x40
  gic_handle_irq+0x5c/0xd0
  ...

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260108-rpmh-regulator-fixes-v1-1-d1b5b300b665@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
This commit is contained in:
Neil Armstrong
2026-01-14 16:25:09 +01:00
committed by Casey Connolly
parent d38ec14953
commit 83dd2675d0
+7
View File
@@ -400,6 +400,13 @@ int rpmh_rsc_send_data(struct rsc_drv *drv, const struct tcs_request *msg)
udelay(1);
}
__tcs_set_trigger(drv, tcs_id, false);
/* Reclaim the TCS */
write_tcs_reg(drv, drv->regs[RSC_DRV_CMD_ENABLE], tcs_id, 0);
writel_relaxed(BIT(tcs_id), drv->tcs_base + drv->regs[RSC_DRV_IRQ_CLEAR]);
generic_clear_bit(tcs_id, drv->tcs_in_use);
if (i == USEC_PER_SEC) {
log_err("%s: error writing %#x to %d:%#x\n", drv->name,
msg->cmds[0].addr, tcs_id, drv->regs[RSC_DRV_CMD_ADDR]);