From: Sneh Mankad <sneh.mankad@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Maulik Shah <quic_mkshah@quicinc.com>
Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Sneh Mankad <sneh.mankad@oss.qualcomm.com>
Subject: [PATCH 2/3] soc: qcom: stats: Add stats compatible and config for Shikra
Date: Fri, 03 Jul 2026 16:43:42 +0530 [thread overview]
Message-ID: <20260703-shikra_stats-v1-2-0aa0ec1fa83e@oss.qualcomm.com> (raw)
In-Reply-To: <20260703-shikra_stats-v1-0-0aa0ec1fa83e@oss.qualcomm.com>
SoC sleep stats are present in RPM message RAM and subsystem sleep
stats are present in SMEM for Shikra.
For earlier targets using RPM processor like msm8974, rpm_master_stat.c
was used for subsystem sleep stats since those stats were populated in
RPM MSGRAM.
Here is a brief summary of previous targets and their stats
configuration, along with the drivers used to display them.
+---------------|----------------------------|---------------------------+
| SoC | subsystem sleep stats | SoC sleep stats |
|---------------|----------------------------|---------------------------|
| msm8974, | RPM processor MSGRAM | RPM processor MSGRAM |
| msm8226 | (rpm_master_stat.c) | (qcom_stats.c) |
|---------------|----------------------------|---------------------------|
| sm6350, | SMEM (DDR) | AOP processor MSGRAM |
| sdm845, etc. | (qcom_stats.c) | (qcom_stats.c) |
|---------------|----------------------------|---------------------------|
| Shikra | SMEM (DDR) | RPM processor MSGRAM |
| | (qcom_stats.c) | (qcom_stats.c) |
+---------------|----------------------------|---------------------------+
qcom_stats.c supports both the configurations for shikra, reading
subsystem sleep stats from SMEM and reading SoC sleep stats from RPM
MSGRAM.
A generic "qcom,rpm-stats" compatible only reads SoC sleep stats like vmin
and vlow. Add shikra rpm compatible and config to read subsystem sleep
stats too along with SoC sleep stats.
Below is an example showing sleep stats for "apss" subsystem with this
change:
cat /sys/kernel/debug/qcom_stats/apss
Count: 2192
Last Entered At: 5498618336
Last Exited At: 5498708046
Accumulated Duration: 2046572620.
Signed-off-by: Sneh Mankad <sneh.mankad@oss.qualcomm.com>
---
drivers/soc/qcom/qcom_stats.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c
index 2e380faf9080354fae120e74f0b9bd1f3786d3e5..2f1615e583bbc6ea596d8b73d9bb0a2a00953cfb 100644
--- a/drivers/soc/qcom/qcom_stats.c
+++ b/drivers/soc/qcom/qcom_stats.c
@@ -376,6 +376,14 @@ static const struct stats_config rpm_data_dba0 = {
.subsystem_stats_in_smem = false,
};
+static const struct stats_config rpm_data_shikra = {
+ .stats_offset = 0,
+ .num_records = 2,
+ .appended_stats_avail = true,
+ .dynamic_offset = true,
+ .subsystem_stats_in_smem = true,
+};
+
static const struct stats_config rpmh_data_sdm845 = {
.stats_offset = 0x48,
.num_records = 2,
@@ -401,6 +409,7 @@ static const struct of_device_id qcom_stats_table[] = {
{ .compatible = "qcom,rpm-stats", .data = &rpm_data },
{ .compatible = "qcom,rpmh-stats", .data = &rpmh_data },
{ .compatible = "qcom,sdm845-rpmh-stats", .data = &rpmh_data_sdm845 },
+ { .compatible = "qcom,shikra-rpm-stats", .data = &rpm_data_shikra },
{ }
};
MODULE_DEVICE_TABLE(of, qcom_stats_table);
--
2.34.1
next prev parent reply other threads:[~2026-07-03 11:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 11:13 [PATCH 0/3] Add subsystem sleep stats support for Shikra Sneh Mankad
2026-07-03 11:13 ` [PATCH 1/3] dt-bindings: soc: qcom: stats: Add compatible " Sneh Mankad
2026-07-06 9:00 ` Maulik Shah (mkshah)
2026-07-06 9:45 ` Konrad Dybcio
2026-07-03 11:13 ` Sneh Mankad [this message]
2026-07-06 9:12 ` [PATCH 2/3] soc: qcom: stats: Add stats compatible and config " Maulik Shah (mkshah)
2026-07-06 9:48 ` Konrad Dybcio
2026-07-03 11:13 ` [PATCH 3/3] arm64: dts: qcom: shikra: Add LPM stats support for subsystems Sneh Mankad
2026-07-06 9:23 ` Maulik Shah (mkshah)
2026-07-06 9:49 ` Konrad Dybcio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260703-shikra_stats-v1-2-0aa0ec1fa83e@oss.qualcomm.com \
--to=sneh.mankad@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_mkshah@quicinc.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox