]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
soc: qcom: rpmh-rsc: reclaim the TCS to avoid spurious irq in Linux
authorNeil Armstrong <neil.armstrong@linaro.org>
Thu, 8 Jan 2026 20:28:43 +0000 (21:28 +0100)
committerCasey Connolly <casey.connolly@linaro.org>
Wed, 14 Jan 2026 15:25:09 +0000 (16:25 +0100)
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>
drivers/soc/qcom/rpmh-rsc.c

index aee9e55194edfb299113f1dbd17586ca8f17d8c2..bc0c3dd005ace0b61048c1156bd6144bb0cd0117 100644 (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]);