[PATCH v2 0/3] Output debug information from RSC
From: Maulik Shah
Date: Fri Jul 17 2026 - 03:53:05 EST
RPMh transfer timeouts are hard to debug — the only indication today
is a WARN_ON() with no record of which TCS was stuck, what resource
it was voting for, or whether AOSS firmware or completion IRQ handling
delay caused the hang.
This series adds structured diagnostics that fire at timeout.
When a timeout occurs today, the only kernel output is a bare warning:
WARNING: drivers/soc/qcom/rpmh.c:386 rpmh_write_batch+0x190/0x2b0
Workqueue: events_unbound deferred_probe_work_func
Call trace:
rpmh_write_batch+0x190/0x2b0 (P)
qcom_icc_bcm_voter_commit+0x33c/0x500
qcom_icc_set+0x20/0x34
icc_node_add+0xf8/0x118
qcom_icc_rpmh_probe+0x194/0x540
platform_probe+0x5c/0xa4
This gives no indication of which TCS was stuck, what resource it was
voting for, or whether AOSS firmware or Linux itself caused the hang.
Patch 1 adds cmd_db_hw_type_str() to cmd-db to decode the accelerator
type (ARC/VRM/BCM) from an RPMh resource address using the existing
SLAVE_ID() encoding. This lives in cmd-db because SLAVE_ID() is a
private macro there and the address encoding is cmd-db's domain.
Patch 2 adds cmd_db_read_name() to cmd-db to reverse-look up the
human-readable resource name (e.g. cx.lvl) from an RPMh address. For
VRM resources, which have up to 4 contiguous addresses per resource,
the match uses VRM_ADDR() on bits [19:4] so any sub-address resolves
to the same name.
Patch 3 adds rpmh_rsc_debug() to rpmh-rsc.c and wires it into both
rpmh_write() and rpmh_write_batch() timeout paths. Per-command output
now shows the accelerator type, resource name, whether the command
requires a response, and the decoded TCS command status bits sourced
from the CMD_STATUS_{TRIGGERED,ISSUED,COMPL} definitions:
addr=0x30000(ARC/cx.lvl) resp-required sts=triggered+sent-to-aoss+resp-received.
Example output on timeout:
[ 0.132051] qcom_rpmh Request: tcs-in-use:YES state=2 wait_for_compl=1
[ 0.132057] qcom_rpmh TCS=0 [ctrlr-sts:BUSY amc-mode:0x1010000 irq-sts:WAITING]
[ 0.132082] qcom_rpmh CMD=0 [addr=0x30000(ARC/cx.lvl) data=0x8 resp-required sts=triggered+sent-to-aoss+resp-received]
[ 0.132098] qcom_rpmh HW IRQ 37 is NOT PENDING at GIC
[ 0.132104] qcom_rpmh Completion is done
[ 0.132108] qcom_rpmh ERROR: Accelerator(s) at AOSS did not respond
Tested on x1e80100-crd (Snapdragon X Elite CRD) with linux-next
next-20260713.
The v1 of the series is at [1].
[1] https://lore.kernel.org/linux-arm-msm/1581504972-22632-1-git-send-email-mkshah@xxxxxxxxxxxxxx/
---
Changes in v2:
- Drop patch2 change from v1
- Add cmd_db_hw_type_str() to cmd-db for accelerator type decoding
- Add cmd_db_read_name() for reverse address-to-name lookup so that
per-cmd output shows the resource name instead of resource address
(e.g. cx.lvl instead of 0x30000)
- Add callers in rpmh_write() and rpmh_write_batch() timeout paths
- Use pr_err() for the opening banner and error conclusion lines;
pr_warn() for intermediate register dumps
- Read CMD_MSGID register per command and print resp-required or
fire-n-forget instead of raw hdr= hex value
- Use CMD_STATUS_{TRIGGERED,ISSUED,COMPL} field descriptions for status
bit strings: triggered, +sent-to-aoss, +resp-received
- Use DONE/WAITING for irq-sts instead of COMPLETED/PENDING
- Rephrase "Possible lockup in Linux" to
"IRQ pending at GIC but not handled within timeout"
- Add more details in commit text
- Link to v1: https://lore.kernel.org/linux-arm-msm/1581504972-22632-1-git-send-email-mkshah@xxxxxxxxxxxxxx/
---
To: Bjorn Andersson <andersson@xxxxxxxxxx>
To: Konrad Dybcio <konradybcio@xxxxxxxxxx>
Cc: linux-arm-msm@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Assisted-by: Claude:claude-sonnet-4-5
Signed-off-by: Maulik Shah <maulik.shah@xxxxxxxxxxxxxxxx>
---
Maulik Shah (2):
soc: qcom: cmd-db: export RPMh accelerator type string helper
soc: qcom: cmd-db: add reverse address-to-name lookup
Raju P.L.S.S.S.N (1):
soc: qcom: rpmh-rsc: Output debug information from RSC
drivers/soc/qcom/cmd-db.c | 65 +++++++++++++++++++++++++++++
drivers/soc/qcom/rpmh-internal.h | 5 +++
drivers/soc/qcom/rpmh-rsc.c | 90 ++++++++++++++++++++++++++++++++++++++++
drivers/soc/qcom/rpmh.c | 4 ++
include/soc/qcom/cmd-db.h | 10 +++++
5 files changed, 174 insertions(+)
---
base-commit: 49362394dad7df66c274c867a271394c10ca2bb8
change-id: 20260714-rpmh-timeout-debug-v1-785f011ce7e3
Best regards,
--
Maulik Shah <maulik.shah@xxxxxxxxxxxxxxxx>