linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add RPM sleep stats for MSM8916
@ 2021-10-18 11:08 Stephan Gerhold
  2021-10-18 11:08 ` [PATCH 1/3] dt-bindings: soc: qcom: stats: Document qcom,rpm-legacy-stats Stephan Gerhold
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Stephan Gerhold @ 2021-10-18 11:08 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming, Maulik Shah, Stephan Gerhold

MSM8916 is similar to the other SoCs that had the RPM stats node added
in commit 290bc68 ("arm64: dts: qcom: Enable RPM Sleep stats").
However, the dynamic offset readable at 0x14 seems only available on
some of the newer RPM firmware versions.

To be absolutely sure, this series adds a new qcom,rpm-legacy-stats
compatible that reads the sleep stats from a fixed offset of 0xdba0.
This approach was originally suggested by Maulik Shah in:
https://lore.kernel.org/linux-arm-msm/c22d57cc-025b-5a8c-91d5-5385292da49f@codeaurora.org/

Stephan Gerhold (3):
  dt-bindings: soc: qcom: stats: Document qcom,rpm-legacy-stats
  soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares
  arm64: dts: qcom: msm8916: Add RPM sleep stats

 .../devicetree/bindings/soc/qcom/qcom-stats.yaml       |  2 ++
 arch/arm64/boot/dts/qcom/msm8916.dtsi                  |  5 +++++
 drivers/soc/qcom/qcom_stats.c                          | 10 ++++++++++
 3 files changed, 17 insertions(+)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] dt-bindings: soc: qcom: stats: Document qcom,rpm-legacy-stats
  2021-10-18 11:08 [PATCH 0/3] Add RPM sleep stats for MSM8916 Stephan Gerhold
@ 2021-10-18 11:08 ` Stephan Gerhold
  2021-10-21  9:29   ` Maulik Shah
  2021-10-26 23:38   ` Rob Herring
  2021-10-18 11:08 ` [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares Stephan Gerhold
  2021-10-18 11:08 ` [PATCH 3/3] arm64: dts: qcom: msm8916: Add RPM sleep stats Stephan Gerhold
  2 siblings, 2 replies; 12+ messages in thread
From: Stephan Gerhold @ 2021-10-18 11:08 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming, Maulik Shah, Stephan Gerhold

Document an additional qcom,rpm-legacy-stats compatible that can be
used similarly to qcom,rpm-stats for older RPM firmware versions that
have the sleep stats at a fixed offset rather than a dynamic one.

Cc: Maulik Shah <mkshah@codeaurora.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml
index 99dff7d73b7e..566678d02008 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml
@@ -21,6 +21,8 @@ properties:
     enum:
       - qcom,rpmh-stats
       - qcom,rpm-stats
+      # For older RPM firmware versions with fixed offset for the sleep stats
+      - qcom,rpm-legacy-stats
 
   reg:
     maxItems: 1
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares
  2021-10-18 11:08 [PATCH 0/3] Add RPM sleep stats for MSM8916 Stephan Gerhold
  2021-10-18 11:08 ` [PATCH 1/3] dt-bindings: soc: qcom: stats: Document qcom,rpm-legacy-stats Stephan Gerhold
@ 2021-10-18 11:08 ` Stephan Gerhold
  2021-10-21  9:30   ` Maulik Shah
  2021-11-18  1:00   ` Bjorn Andersson
  2021-10-18 11:08 ` [PATCH 3/3] arm64: dts: qcom: msm8916: Add RPM sleep stats Stephan Gerhold
  2 siblings, 2 replies; 12+ messages in thread
From: Stephan Gerhold @ 2021-10-18 11:08 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming, Maulik Shah, Stephan Gerhold

Not all RPM firmware versions have the dynamic sleep stats offset
available. Older versions use a fixed offset of 0xdba0.

Add support for this using a new qcom,rpm-legacy-stats compatible
that can be used for older SoCs like MSM8916.

Suggested-by: Maulik Shah <mkshah@codeaurora.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 drivers/soc/qcom/qcom_stats.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c
index 817505bd99b5..67728de718fd 100644
--- a/drivers/soc/qcom/qcom_stats.c
+++ b/drivers/soc/qcom/qcom_stats.c
@@ -237,6 +237,15 @@ static const struct stats_config rpm_data = {
 	.subsystem_stats_in_smem = false,
 };
 
+/* Older RPM firmwares have the stats at a fixed offset instead */
+static const struct stats_config rpm_legacy_data = {
+	.stats_offset = 0xdba0,
+	.num_records = 2,
+	.appended_stats_avail = true,
+	.dynamic_offset = false,
+	.subsystem_stats_in_smem = false,
+};
+
 static const struct stats_config rpmh_data = {
 	.stats_offset = 0x48,
 	.num_records = 3,
@@ -247,6 +256,7 @@ static const struct stats_config rpmh_data = {
 
 static const struct of_device_id qcom_stats_table[] = {
 	{ .compatible = "qcom,rpm-stats", .data = &rpm_data },
+	{ .compatible = "qcom,rpm-legacy-stats", .data = &rpm_legacy_data },
 	{ .compatible = "qcom,rpmh-stats", .data = &rpmh_data },
 	{ }
 };
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] arm64: dts: qcom: msm8916: Add RPM sleep stats
  2021-10-18 11:08 [PATCH 0/3] Add RPM sleep stats for MSM8916 Stephan Gerhold
  2021-10-18 11:08 ` [PATCH 1/3] dt-bindings: soc: qcom: stats: Document qcom,rpm-legacy-stats Stephan Gerhold
  2021-10-18 11:08 ` [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares Stephan Gerhold
@ 2021-10-18 11:08 ` Stephan Gerhold
  2021-10-21  9:30   ` Maulik Shah
  2 siblings, 1 reply; 12+ messages in thread
From: Stephan Gerhold @ 2021-10-18 11:08 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming, Maulik Shah, Stephan Gerhold

MSM8916 is similar to the other SoCs that had the RPM stats node added
in commit 290bc6846547 ("arm64: dts: qcom: Enable RPM Sleep stats").
However, the dynamic offset readable at 0x14 seems only available on
some of the newer firmware versions. To be absolutely sure, make use
of the new qcom,rpm-legacy-stats compatible that reads the sleep stats
from a fixed offset of 0xdba0.

Statistics are available for a "vmin" and "xosd" low power mode:

$ cat /sys/kernel/debug/qcom_stats/vmin
Count: 0
Last Entered At: 0
Last Exited At: 0
Accumulated Duration: 0
Client Votes: 0x0
$ cat /sys/kernel/debug/qcom_stats/xosd
Count: 0
Last Entered At: 0
Last Exited At: 0
Accumulated Duration: 0
Client Votes: 0x0

Cc: Maulik Shah <mkshah@codeaurora.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 43464ac64f3e..99f7999aad2d 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -445,6 +445,11 @@ rpm_msg_ram: sram@60000 {
 			reg = <0x00060000 0x8000>;
 		};
 
+		sram@290000 {
+			compatible = "qcom,rpm-legacy-stats";
+			reg = <0x00290000 0x10000>;
+		};
+
 		bimc: interconnect@400000 {
 			compatible = "qcom,msm8916-bimc";
 			reg = <0x00400000 0x62000>;
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] dt-bindings: soc: qcom: stats: Document qcom,rpm-legacy-stats
  2021-10-18 11:08 ` [PATCH 1/3] dt-bindings: soc: qcom: stats: Document qcom,rpm-legacy-stats Stephan Gerhold
@ 2021-10-21  9:29   ` Maulik Shah
  2021-10-26 23:38   ` Rob Herring
  1 sibling, 0 replies; 12+ messages in thread
From: Maulik Shah @ 2021-10-21  9:29 UTC (permalink / raw)
  To: Stephan Gerhold, Bjorn Andersson
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming

Hi,

Reviewed-by: Maulik Shah <mkshah@codeaurora.org>

Thanks,
Maulik

On 10/18/2021 4:38 PM, Stephan Gerhold wrote:
> Document an additional qcom,rpm-legacy-stats compatible that can be
> used similarly to qcom,rpm-stats for older RPM firmware versions that
> have the sleep stats at a fixed offset rather than a dynamic one.
> 
> Cc: Maulik Shah <mkshah@codeaurora.org>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
>   Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml
> index 99dff7d73b7e..566678d02008 100644
> --- a/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml
> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml
> @@ -21,6 +21,8 @@ properties:
>       enum:
>         - qcom,rpmh-stats
>         - qcom,rpm-stats
> +      # For older RPM firmware versions with fixed offset for the sleep stats
> +      - qcom,rpm-legacy-stats
>   
>     reg:
>       maxItems: 1
> 

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a 
member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares
  2021-10-18 11:08 ` [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares Stephan Gerhold
@ 2021-10-21  9:30   ` Maulik Shah
  2021-11-18  1:00   ` Bjorn Andersson
  1 sibling, 0 replies; 12+ messages in thread
From: Maulik Shah @ 2021-10-21  9:30 UTC (permalink / raw)
  To: Stephan Gerhold, Bjorn Andersson
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming

Hi,

Reviewed-by: Maulik Shah <mkshah@codeaurora.org>

Thanks,
Maulik

On 10/18/2021 4:38 PM, Stephan Gerhold wrote:
> Not all RPM firmware versions have the dynamic sleep stats offset
> available. Older versions use a fixed offset of 0xdba0.
> 
> Add support for this using a new qcom,rpm-legacy-stats compatible
> that can be used for older SoCs like MSM8916.
> 
> Suggested-by: Maulik Shah <mkshah@codeaurora.org>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
>   drivers/soc/qcom/qcom_stats.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c
> index 817505bd99b5..67728de718fd 100644
> --- a/drivers/soc/qcom/qcom_stats.c
> +++ b/drivers/soc/qcom/qcom_stats.c
> @@ -237,6 +237,15 @@ static const struct stats_config rpm_data = {
>   	.subsystem_stats_in_smem = false,
>   };
>   
> +/* Older RPM firmwares have the stats at a fixed offset instead */
> +static const struct stats_config rpm_legacy_data = {
> +	.stats_offset = 0xdba0,
> +	.num_records = 2,
> +	.appended_stats_avail = true,
> +	.dynamic_offset = false,
> +	.subsystem_stats_in_smem = false,
> +};
> +
>   static const struct stats_config rpmh_data = {
>   	.stats_offset = 0x48,
>   	.num_records = 3,
> @@ -247,6 +256,7 @@ static const struct stats_config rpmh_data = {
>   
>   static const struct of_device_id qcom_stats_table[] = {
>   	{ .compatible = "qcom,rpm-stats", .data = &rpm_data },
> +	{ .compatible = "qcom,rpm-legacy-stats", .data = &rpm_legacy_data },
>   	{ .compatible = "qcom,rpmh-stats", .data = &rpmh_data },
>   	{ }
>   };
> 

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a 
member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: msm8916: Add RPM sleep stats
  2021-10-18 11:08 ` [PATCH 3/3] arm64: dts: qcom: msm8916: Add RPM sleep stats Stephan Gerhold
@ 2021-10-21  9:30   ` Maulik Shah
  0 siblings, 0 replies; 12+ messages in thread
From: Maulik Shah @ 2021-10-21  9:30 UTC (permalink / raw)
  To: Stephan Gerhold, Bjorn Andersson
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming

Hi,

Reviewed-by: Maulik Shah <mkshah@codeaurora.org>

Thanks,
Maulik

On 10/18/2021 4:38 PM, Stephan Gerhold wrote:
> MSM8916 is similar to the other SoCs that had the RPM stats node added
> in commit 290bc6846547 ("arm64: dts: qcom: Enable RPM Sleep stats").
> However, the dynamic offset readable at 0x14 seems only available on
> some of the newer firmware versions. To be absolutely sure, make use
> of the new qcom,rpm-legacy-stats compatible that reads the sleep stats
> from a fixed offset of 0xdba0.
> 
> Statistics are available for a "vmin" and "xosd" low power mode:
> 
> $ cat /sys/kernel/debug/qcom_stats/vmin
> Count: 0
> Last Entered At: 0
> Last Exited At: 0
> Accumulated Duration: 0
> Client Votes: 0x0
> $ cat /sys/kernel/debug/qcom_stats/xosd
> Count: 0
> Last Entered At: 0
> Last Exited At: 0
> Accumulated Duration: 0
> Client Votes: 0x0
> 
> Cc: Maulik Shah <mkshah@codeaurora.org>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
>   arch/arm64/boot/dts/qcom/msm8916.dtsi | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index 43464ac64f3e..99f7999aad2d 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> @@ -445,6 +445,11 @@ rpm_msg_ram: sram@60000 {
>   			reg = <0x00060000 0x8000>;
>   		};
>   
> +		sram@290000 {
> +			compatible = "qcom,rpm-legacy-stats";
> +			reg = <0x00290000 0x10000>;
> +		};
> +
>   		bimc: interconnect@400000 {
>   			compatible = "qcom,msm8916-bimc";
>   			reg = <0x00400000 0x62000>;
> 

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a 
member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] dt-bindings: soc: qcom: stats: Document qcom,rpm-legacy-stats
  2021-10-18 11:08 ` [PATCH 1/3] dt-bindings: soc: qcom: stats: Document qcom,rpm-legacy-stats Stephan Gerhold
  2021-10-21  9:29   ` Maulik Shah
@ 2021-10-26 23:38   ` Rob Herring
  1 sibling, 0 replies; 12+ messages in thread
From: Rob Herring @ 2021-10-26 23:38 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: Andy Gross, Rob Herring, ~postmarketos/upstreaming, devicetree,
	linux-arm-msm, Bjorn Andersson, Maulik Shah

On Mon, 18 Oct 2021 13:08:01 +0200, Stephan Gerhold wrote:
> Document an additional qcom,rpm-legacy-stats compatible that can be
> used similarly to qcom,rpm-stats for older RPM firmware versions that
> have the sleep stats at a fixed offset rather than a dynamic one.
> 
> Cc: Maulik Shah <mkshah@codeaurora.org>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
>  Documentation/devicetree/bindings/soc/qcom/qcom-stats.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares
  2021-10-18 11:08 ` [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares Stephan Gerhold
  2021-10-21  9:30   ` Maulik Shah
@ 2021-11-18  1:00   ` Bjorn Andersson
  2021-11-18 10:45     ` Stephan Gerhold
  1 sibling, 1 reply; 12+ messages in thread
From: Bjorn Andersson @ 2021-11-18  1:00 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming, Maulik Shah

On Mon 18 Oct 06:08 CDT 2021, Stephan Gerhold wrote:

> Not all RPM firmware versions have the dynamic sleep stats offset
> available. Older versions use a fixed offset of 0xdba0.
> 
> Add support for this using a new qcom,rpm-legacy-stats compatible
> that can be used for older SoCs like MSM8916.
> 
> Suggested-by: Maulik Shah <mkshah@codeaurora.org>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
>  drivers/soc/qcom/qcom_stats.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c
> index 817505bd99b5..67728de718fd 100644
> --- a/drivers/soc/qcom/qcom_stats.c
> +++ b/drivers/soc/qcom/qcom_stats.c
> @@ -237,6 +237,15 @@ static const struct stats_config rpm_data = {
>  	.subsystem_stats_in_smem = false,
>  };
>  
> +/* Older RPM firmwares have the stats at a fixed offset instead */
> +static const struct stats_config rpm_legacy_data = {
> +	.stats_offset = 0xdba0,
> +	.num_records = 2,
> +	.appended_stats_avail = true,
> +	.dynamic_offset = false,
> +	.subsystem_stats_in_smem = false,
> +};

Is this the only variation that existed back in the "legacy" days? Will
we end up with multiple "legacy" variants?

> +
>  static const struct stats_config rpmh_data = {
>  	.stats_offset = 0x48,
>  	.num_records = 3,
> @@ -247,6 +256,7 @@ static const struct stats_config rpmh_data = {
>  
>  static const struct of_device_id qcom_stats_table[] = {
>  	{ .compatible = "qcom,rpm-stats", .data = &rpm_data },
> +	{ .compatible = "qcom,rpm-legacy-stats", .data = &rpm_legacy_data },

'l' < 's'...

Regards,
Bjorn

>  	{ .compatible = "qcom,rpmh-stats", .data = &rpmh_data },
>  	{ }
>  };
> -- 
> 2.33.0
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares
  2021-11-18  1:00   ` Bjorn Andersson
@ 2021-11-18 10:45     ` Stephan Gerhold
  2021-11-18 20:58       ` Bjorn Andersson
  0 siblings, 1 reply; 12+ messages in thread
From: Stephan Gerhold @ 2021-11-18 10:45 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming, Maulik Shah

On Wed, Nov 17, 2021 at 07:00:58PM -0600, Bjorn Andersson wrote:
> On Mon 18 Oct 06:08 CDT 2021, Stephan Gerhold wrote:
> 
> > Not all RPM firmware versions have the dynamic sleep stats offset
> > available. Older versions use a fixed offset of 0xdba0.
> > 
> > Add support for this using a new qcom,rpm-legacy-stats compatible
> > that can be used for older SoCs like MSM8916.
> > 
> > Suggested-by: Maulik Shah <mkshah@codeaurora.org>
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> >  drivers/soc/qcom/qcom_stats.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c
> > index 817505bd99b5..67728de718fd 100644
> > --- a/drivers/soc/qcom/qcom_stats.c
> > +++ b/drivers/soc/qcom/qcom_stats.c
> > @@ -237,6 +237,15 @@ static const struct stats_config rpm_data = {
> >  	.subsystem_stats_in_smem = false,
> >  };
> >  
> > +/* Older RPM firmwares have the stats at a fixed offset instead */
> > +static const struct stats_config rpm_legacy_data = {
> > +	.stats_offset = 0xdba0,
> > +	.num_records = 2,
> > +	.appended_stats_avail = true,
> > +	.dynamic_offset = false,
> > +	.subsystem_stats_in_smem = false,
> > +};
> 
> Is this the only variation that existed back in the "legacy" days? Will
> we end up with multiple "legacy" variants?
> 

I think most old platforms that are still somewhat maintained use 0xdba0
(e.g. MSM8916, MSM8974, APQ8084, MSM8226).
I found a different offset for APQ8064, MSM8960, but they also seem to
use a different stats format ("v1" instead of "v2") which is not
currently supported by the qcom_stats driver here.

I guess I could add SoC-specific compatibles if you prefer (e.g.
"qcom,rpm-stats-msm8916"), or do you have any other suggestion?

Thanks,
Stephan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares
  2021-11-18 10:45     ` Stephan Gerhold
@ 2021-11-18 20:58       ` Bjorn Andersson
  2021-11-18 21:26         ` Stephan Gerhold
  0 siblings, 1 reply; 12+ messages in thread
From: Bjorn Andersson @ 2021-11-18 20:58 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming, Maulik Shah

On Thu 18 Nov 04:45 CST 2021, Stephan Gerhold wrote:

> On Wed, Nov 17, 2021 at 07:00:58PM -0600, Bjorn Andersson wrote:
> > On Mon 18 Oct 06:08 CDT 2021, Stephan Gerhold wrote:
> > 
> > > Not all RPM firmware versions have the dynamic sleep stats offset
> > > available. Older versions use a fixed offset of 0xdba0.
> > > 
> > > Add support for this using a new qcom,rpm-legacy-stats compatible
> > > that can be used for older SoCs like MSM8916.
> > > 
> > > Suggested-by: Maulik Shah <mkshah@codeaurora.org>
> > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > > ---
> > >  drivers/soc/qcom/qcom_stats.c | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > > 
> > > diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c
> > > index 817505bd99b5..67728de718fd 100644
> > > --- a/drivers/soc/qcom/qcom_stats.c
> > > +++ b/drivers/soc/qcom/qcom_stats.c
> > > @@ -237,6 +237,15 @@ static const struct stats_config rpm_data = {
> > >  	.subsystem_stats_in_smem = false,
> > >  };
> > >  
> > > +/* Older RPM firmwares have the stats at a fixed offset instead */
> > > +static const struct stats_config rpm_legacy_data = {
> > > +	.stats_offset = 0xdba0,
> > > +	.num_records = 2,
> > > +	.appended_stats_avail = true,
> > > +	.dynamic_offset = false,
> > > +	.subsystem_stats_in_smem = false,
> > > +};
> > 
> > Is this the only variation that existed back in the "legacy" days? Will
> > we end up with multiple "legacy" variants?
> > 
> 
> I think most old platforms that are still somewhat maintained use 0xdba0
> (e.g. MSM8916, MSM8974, APQ8084, MSM8226).
> I found a different offset for APQ8064, MSM8960, but they also seem to
> use a different stats format ("v1" instead of "v2") which is not
> currently supported by the qcom_stats driver here.
> 

Okay, so there's an even more legacy format as well...

> I guess I could add SoC-specific compatibles if you prefer (e.g.
> "qcom,rpm-stats-msm8916"), or do you have any other suggestion?
> 

Yes, as we have examples of another "legacy format" I would prefer that
we sprinkle some platform names in there; and as newer platforms all
seems to use the same format this effort should be bound to whatever old
platforms we end up supporting.

Nit. I would prefer the qcom,msm8916-rpm-stats format though.

Regards,
Bjorn

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares
  2021-11-18 20:58       ` Bjorn Andersson
@ 2021-11-18 21:26         ` Stephan Gerhold
  0 siblings, 0 replies; 12+ messages in thread
From: Stephan Gerhold @ 2021-11-18 21:26 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, linux-arm-msm, Rob Herring, devicetree,
	~postmarketos/upstreaming, Maulik Shah

On Thu, Nov 18, 2021 at 02:58:50PM -0600, Bjorn Andersson wrote:
> On Thu 18 Nov 04:45 CST 2021, Stephan Gerhold wrote:
> 
> > On Wed, Nov 17, 2021 at 07:00:58PM -0600, Bjorn Andersson wrote:
> > > On Mon 18 Oct 06:08 CDT 2021, Stephan Gerhold wrote:
> > > 
> > > > Not all RPM firmware versions have the dynamic sleep stats offset
> > > > available. Older versions use a fixed offset of 0xdba0.
> > > > 
> > > > Add support for this using a new qcom,rpm-legacy-stats compatible
> > > > that can be used for older SoCs like MSM8916.
> > > > 
> > > > Suggested-by: Maulik Shah <mkshah@codeaurora.org>
> > > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > > > ---
> > > >  drivers/soc/qcom/qcom_stats.c | 10 ++++++++++
> > > >  1 file changed, 10 insertions(+)
> > > > 
> > > > diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c
> > > > index 817505bd99b5..67728de718fd 100644
> > > > --- a/drivers/soc/qcom/qcom_stats.c
> > > > +++ b/drivers/soc/qcom/qcom_stats.c
> > > > @@ -237,6 +237,15 @@ static const struct stats_config rpm_data = {
> > > >  	.subsystem_stats_in_smem = false,
> > > >  };
> > > >  
> > > > +/* Older RPM firmwares have the stats at a fixed offset instead */
> > > > +static const struct stats_config rpm_legacy_data = {
> > > > +	.stats_offset = 0xdba0,
> > > > +	.num_records = 2,
> > > > +	.appended_stats_avail = true,
> > > > +	.dynamic_offset = false,
> > > > +	.subsystem_stats_in_smem = false,
> > > > +};
> > > 
> > > Is this the only variation that existed back in the "legacy" days? Will
> > > we end up with multiple "legacy" variants?
> > > 
> > 
> > I think most old platforms that are still somewhat maintained use 0xdba0
> > (e.g. MSM8916, MSM8974, APQ8084, MSM8226).
> > I found a different offset for APQ8064, MSM8960, but they also seem to
> > use a different stats format ("v1" instead of "v2") which is not
> > currently supported by the qcom_stats driver here.
> > 
> 
> Okay, so there's an even more legacy format as well...
> 

We could use qcom,rpm-even-more-legacy-stats for those. ;D (just kidding)

> > I guess I could add SoC-specific compatibles if you prefer (e.g.
> > "qcom,rpm-stats-msm8916"), or do you have any other suggestion?
> > 
> 
> Yes, as we have examples of another "legacy format" I would prefer that
> we sprinkle some platform names in there; and as newer platforms all
> seems to use the same format this effort should be bound to whatever old
> platforms we end up supporting.
> 
> Nit. I would prefer the qcom,msm8916-rpm-stats format though.
> 

Both sound good to me, I will send a v2 with the
"qcom,msm8916-rpm-stats" compatible instead.

Thanks,
Stephan

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-11-18 21:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 11:08 [PATCH 0/3] Add RPM sleep stats for MSM8916 Stephan Gerhold
2021-10-18 11:08 ` [PATCH 1/3] dt-bindings: soc: qcom: stats: Document qcom,rpm-legacy-stats Stephan Gerhold
2021-10-21  9:29   ` Maulik Shah
2021-10-26 23:38   ` Rob Herring
2021-10-18 11:08 ` [PATCH 2/3] soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares Stephan Gerhold
2021-10-21  9:30   ` Maulik Shah
2021-11-18  1:00   ` Bjorn Andersson
2021-11-18 10:45     ` Stephan Gerhold
2021-11-18 20:58       ` Bjorn Andersson
2021-11-18 21:26         ` Stephan Gerhold
2021-10-18 11:08 ` [PATCH 3/3] arm64: dts: qcom: msm8916: Add RPM sleep stats Stephan Gerhold
2021-10-21  9:30   ` Maulik Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).