Re: [PATCH v4 3/3] soc: qcom: rpmh-rsc: Output debug information from RSC
From: Konrad Dybcio
Date: Mon Sep 21 2026 - 06:47:16 EST
On 9/13/26 2:54 PM, Maulik Shah wrote:
> From: "Raju P.L.S.S.S.N" <rplsssn@xxxxxxxxxxxxxx>
>
> When an RPMh transfer times out there is no visibility into which
> TCS was stuck, what commands it was carrying, or whether the
> completion IRQ was pending at the GIC. Add rpmh_rsc_debug() to
> capture this state at timeout:
Some feedback from GPT
[...]
> +print_tcs_data:
> + /* All TCSes on a given RSC have the same number of commands per TCS. */
> + for_each_set_bit(i, &cmds_enabled, drv->tcs[0].ncpt) {
> + addr = read_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_ADDR], tcs_id, i);
> + data = read_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_DATA], tcs_id, i);
> + msgid = read_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_MSGID], tcs_id, i);
> + sts = read_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_STATUS], tcs_id, i);
> + cmd_db_read_name(addr, rname, sizeof(rname));
This call may fail and must be checked
[...]
> +void rpmh_rsc_debug(struct rsc_drv *drv, struct completion *compl)
> +{
> + struct irq_data *rsc_irq_data = irq_get_irq_data(drv->irq);
> + bool gic_irq_sts, aoss_irq_sts = false;
> + int i, busy = 0;
> +
> + dev_err(drv->dev, "Timeout on RSC %s\n", drv->name);
> +
> + for (i = 0; i < drv->num_tcs; i++) {
> + if (!test_bit(i, drv->tcs_in_use))
> + continue;
> + busy++;
> + print_tcs_info(drv, i, &aoss_irq_sts);
2. P2 — Patch 3 retains only the last TCS’s AOSS completion state
rpmh_rsc_debug() iterates all in-use TCSes, but print_tcs_info() assigns
rather than accumulates:
*aoss_irq_sts = !!(irq_sts & BIT(tcs_id));
> + }
> +
> + if (!rsc_irq_data) {
> + dev_err(drv->dev, "No IRQ data for RSC:%s\n", drv->name);
> + return;
> + }
> +
> + irq_get_irqchip_state(drv->irq, IRQCHIP_STATE_PENDING, &gic_irq_sts);
This call can reportedly also fail
Konrad