Re: [PATCH v3 3/3] soc: qcom: rpmh-rsc: Output debug information from RSC

From: Maulik Shah

Date: Sun Sep 13 2026 - 08:30:37 EST



On 17-08-2026 19:58, Konrad Dybcio wrote:
> On 8/12/26 8:12 AM, 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:
> [...]
>
> Looking good overall, some minor comments
>
>> +static void print_tcs_info(struct rsc_drv *drv, int tcs_id,
>> + bool *aoss_irq_sts)
>> +{
>> + const struct tcs_request *req = get_req_from_tcs(drv, tcs_id);
>> + unsigned long cmds_enabled;
>> + char rname[CMD_DB_ID_SIZE + 1];
>> + u32 addr, data, msgid, sts, irq_sts;
>> + bool in_use = test_bit(tcs_id, drv->tcs_in_use);
>> + int i;
>> +
>> + sts = read_tcs_reg(drv, drv->regs[RSC_DRV_STATUS], tcs_id);
>> + cmds_enabled = read_tcs_reg(drv, drv->regs[RSC_DRV_CMD_ENABLE], tcs_id);
>> + if (!cmds_enabled)
>> + return;
>> +
>> + if (!req)
>> + goto print_tcs_data;
>> +
>> + data = read_tcs_reg(drv, drv->regs[RSC_DRV_CONTROL], tcs_id);
>> + irq_sts = readl_relaxed(drv->tcs_base + drv->regs[RSC_DRV_IRQ_STATUS]);
>> + pr_warn("Request: tcs-in-use:%s state=%d wait_for_compl=%u\n",
> Let's use dev_foo() everywhere instead of pr_foo, you have a struct dev* in
> drv->dev
Ack.
>> + in_use ? "YES" : "NO",
> Please use str_yes_no() here, or AI contributors will rush to "fix" it..
>
> [...]
Ack.
>
>> +/**
>> + * rpmh_rsc_debug() - Dump debug information on a transfer timeout.
>> + * @drv: The RSC controller.
>> + * @compl: The completion object that timed out.
>> + *
>> + * Dumps TCS state for all in-use TCSes and reports which accelerators
>> + * did not respond, to aid in diagnosing RPMH timeout failures.
>> + */
>> +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;
>> +
>> + pr_err("RSC:%s\n", drv->name);
> Let's perhaps touch this up to sth like "Timeout on RSC %s\n"

Ack. Updates in v4.

Thanks,
Maulik
>
> Konrad