From 2d8780e63aad0acd05240c6dc099bbce161b5944 Mon Sep 17 00:00:00 2001 From: Sneh Mankad Date: Wed, 24 Jun 2026 15:16:09 +0530 Subject: [PATCH 1/3] FROMLIST: dt-bindings: soc: qcom: stats: Add compatible for Shikra SoC LPM stats are present in RPM MSGRAM and subsystem LPM stats are present in SMEM for Shikra. A generic "qcom,rpm-stats" compatible only reads SoC LPM stats like vmin and vlow. Document shikra rpm compatible to read subsystem LPM stats too along with SoC LPM stats. Link: https://lore.kernel.org/r/20260713-shikra_stats-v3-1-4be17121729d@oss.qualcomm.com Reviewed-by: Maulik Shah Signed-off-by: Sneh Mankad --- Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml index 686a7ef2f48af..43751115c5b4e 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml @@ -27,6 +27,7 @@ properties: - qcom,msm8226-rpm-stats - qcom,msm8916-rpm-stats - qcom,msm8974-rpm-stats + - qcom,shikra-rpm-stats reg: maxItems: 1 From 913b8d61d6ddf55cee67eae00b63f4e217167c9a Mon Sep 17 00:00:00 2001 From: Sneh Mankad Date: Wed, 24 Jun 2026 15:19:36 +0530 Subject: [PATCH 2/3] FROMLIST: soc: qcom: stats: Add stats compatible and config for Shikra SoC LPM stats are present in RPM MSGRAM and subsystem LPM stats are present in SMEM for Shikra. For earlier targets using RPM processor like msm8974, rpm_master_stat.c was used for subsystem LPM 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 LPM stats | SoC LPM 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 LPM stats from SMEM and reading SoC LPM stats from RPM MSGRAM. A generic "qcom,rpm-stats" compatible only reads SoC LPM stats like vmin and vlow. Add shikra rpm compatible and config to read subsystem LPM stats too along with SoC LPM stats. Below is an example showing LPM 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. Link: https://lore.kernel.org/r/20260713-shikra_stats-v3-2-4be17121729d@oss.qualcomm.com Reviewed-by: Konrad Dybcio Reviewed-by: Maulik Shah Signed-off-by: Sneh Mankad --- 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 2e380faf90803..2f1615e583bbc 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); From 57cc7903b3a17c2a234947623c4686c2556b0563 Mon Sep 17 00:00:00 2001 From: Sneh Mankad Date: Wed, 24 Jun 2026 15:21:33 +0530 Subject: [PATCH 3/3] FROMLIST: arm64: dts: qcom: shikra: Update rpm-stats compatible to SoC specific A generic "qcom,rpm-stats" compatible only reads stats for SoC level LPM stats like vmin and vlow. Shikra SoC specific compatible allows reading individual subsystem level LPM stats along with SoC level LPM stats. Change it. Keep "qcom,rpm-stats" as fallback compatible. Link: https://lore.kernel.org/r/20260713-shikra_stats-v3-3-4be17121729d@oss.qualcomm.com Reviewed-by: Konrad Dybcio Signed-off-by: Sneh Mankad --- arch/arm64/boot/dts/qcom/shikra.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/shikra.dtsi b/arch/arm64/boot/dts/qcom/shikra.dtsi index 812ad89a649e2..2d868b5985981 100644 --- a/arch/arm64/boot/dts/qcom/shikra.dtsi +++ b/arch/arm64/boot/dts/qcom/shikra.dtsi @@ -1510,7 +1510,7 @@ }; sram@4690000 { - compatible = "qcom,rpm-stats"; + compatible = "qcom,shikra-rpm-stats", "qcom,rpm-stats"; reg = <0x0 0x04690000 0x0 0x14000>; };