From: Neil Armstrong Date: Thu, 8 Jan 2026 20:28:43 +0000 (+0100) Subject: soc: qcom: rpmh-rsc: reclaim the TCS to avoid spurious irq in Linux X-Git-Tag: v2026.04-rc1~31^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83dd2675d04f5247d6796fa6294d717069fae19c;p=thirdparty%2Fu-boot.git 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 Link: https://patch.msgid.link/20260108-rpmh-regulator-fixes-v1-1-d1b5b300b665@linaro.org Signed-off-by: Casey Connolly --- diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c index aee9e55194e..bc0c3dd005a 100644 --- a/drivers/soc/qcom/rpmh-rsc.c +++ b/drivers/soc/qcom/rpmh-rsc.c @@ -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]);