2021-02-04 14:29:54

by Maulik Shah

[permalink] [raw]
Subject: [PATCH v6 1/4] dt-bindings: Introduce SoC sleep stats bindings

From: Mahesh Sivasubramanian <[email protected]>

Add device binding documentation for Qualcomm Technologies, Inc. (QTI)
SoC sleep stats driver. The driver is used for displaying SoC sleep
statistic maintained by Always On Processor or Resource Power Manager.

Cc: [email protected]
Signed-off-by: Mahesh Sivasubramanian <[email protected]>
Signed-off-by: Lina Iyer <[email protected]>
Signed-off-by: Maulik Shah <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Reviewed-by: Bjorn Andersson <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---
.../bindings/soc/qcom/soc-sleep-stats.yaml | 46 ++++++++++++++++++++++
1 file changed, 46 insertions(+)
create mode 100644 Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml

diff --git a/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml b/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml
new file mode 100644
index 0000000..1e012ba
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/qcom/soc-sleep-stats.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Technologies, Inc. (QTI) SoC sleep stats bindings
+
+maintainers:
+ - Maulik Shah <[email protected]>
+ - Lina Iyer <[email protected]>
+
+description:
+ Always On Processor/Resource Power Manager maintains statistics of the SoC
+ sleep modes involving powering down of the rails and oscillator clock.
+
+ Statistics includes SoC sleep mode type, number of times low power mode were
+ entered, time of last entry, time of last exit and accumulated sleep duration.
+
+properties:
+ compatible:
+ enum:
+ - qcom,rpmh-sleep-stats
+ - qcom,rpm-sleep-stats
+
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+
+examples:
+ # Example of rpmh sleep stats
+ - |
+ rpmh-sleep-stats@c3f0000 {
+ compatible = "qcom,rpmh-sleep-stats";
+ reg = <0 0x0c3f0000 0 0x400>;
+ };
+ # Example of rpm sleep stats
+ - |
+ rpm-sleep-stats@4690000 {
+ compatible = "qcom,rpm-sleep-stats";
+ reg = <0 0x04690000 0 0x400>;
+ };
+...
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


2021-02-04 21:11:50

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v6 1/4] dt-bindings: Introduce SoC sleep stats bindings

On Thu, 04 Feb 2021 19:51:45 +0530, Maulik Shah wrote:
> From: Mahesh Sivasubramanian <[email protected]>
>
> Add device binding documentation for Qualcomm Technologies, Inc. (QTI)
> SoC sleep stats driver. The driver is used for displaying SoC sleep
> statistic maintained by Always On Processor or Resource Power Manager.
>
> Cc: [email protected]
> Signed-off-by: Mahesh Sivasubramanian <[email protected]>
> Signed-off-by: Lina Iyer <[email protected]>
> Signed-off-by: Maulik Shah <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>
> Reviewed-by: Bjorn Andersson <[email protected]>
> Reviewed-by: Stephen Boyd <[email protected]>
> ---
> .../bindings/soc/qcom/soc-sleep-stats.yaml | 46 ++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml
>

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml: 'additionalProperties' is a required property
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml: ignoring, error in schema:
warning: no schema found in file: ./Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.example.dt.yaml: example-0: rpmh-sleep-stats@c3f0000:reg:0: [0, 205455360, 0, 1024] is too long
From schema: /usr/local/lib/python3.8/dist-packages/dtschema/schemas/reg.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.example.dt.yaml: example-1: rpm-sleep-stats@4690000:reg:0: [0, 73990144, 0, 1024] is too long
From schema: /usr/local/lib/python3.8/dist-packages/dtschema/schemas/reg.yaml

See https://patchwork.ozlabs.org/patch/1436034

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.

2021-02-09 00:26:40

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH v6 1/4] dt-bindings: Introduce SoC sleep stats bindings

Quoting Maulik Shah (2021-02-04 06:21:45)
> +
> +description:
> + Always On Processor/Resource Power Manager maintains statistics of the SoC
> + sleep modes involving powering down of the rails and oscillator clock.
> +
> + Statistics includes SoC sleep mode type, number of times low power mode were
> + entered, time of last entry, time of last exit and accumulated sleep duration.
> +
> +properties:
> + compatible:
> + enum:
> + - qcom,rpmh-sleep-stats
> + - qcom,rpm-sleep-stats
> +
> + reg:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> +
> +examples:
> + # Example of rpmh sleep stats
> + - |
> + rpmh-sleep-stats@c3f0000 {
> + compatible = "qcom,rpmh-sleep-stats";
> + reg = <0 0x0c3f0000 0 0x400>;
> + };

Maybe it should just be another reg property of the rpmh or rpm node?
Then the rpmh driver can create the stats "device" at driver probe time,
or just roll it into the same thing. It looks pretty weird to have a
device in DT for this given that it's not really hardware, more like a
place that the processor writes some stuff about what's going on in the
SoC related to power management.

> + # Example of rpm sleep stats
> + - |
> + rpm-sleep-stats@4690000 {
> + compatible = "qcom,rpm-sleep-stats";
> + reg = <0 0x04690000 0 0x400>;
> + };
> +...

2021-03-12 17:15:43

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v6 1/4] dt-bindings: Introduce SoC sleep stats bindings

On Mon 08 Feb 18:23 CST 2021, Stephen Boyd wrote:

> Quoting Maulik Shah (2021-02-04 06:21:45)
> > +
> > +description:
> > + Always On Processor/Resource Power Manager maintains statistics of the SoC
> > + sleep modes involving powering down of the rails and oscillator clock.
> > +
> > + Statistics includes SoC sleep mode type, number of times low power mode were
> > + entered, time of last entry, time of last exit and accumulated sleep duration.
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - qcom,rpmh-sleep-stats
> > + - qcom,rpm-sleep-stats
> > +
> > + reg:
> > + maxItems: 1
> > +
> > +required:
> > + - compatible
> > + - reg
> > +
> > +examples:
> > + # Example of rpmh sleep stats
> > + - |
> > + rpmh-sleep-stats@c3f0000 {
> > + compatible = "qcom,rpmh-sleep-stats";
> > + reg = <0 0x0c3f0000 0 0x400>;
> > + };
>
> Maybe it should just be another reg property of the rpmh or rpm node?
> Then the rpmh driver can create the stats "device" at driver probe time,
> or just roll it into the same thing. It looks pretty weird to have a
> device in DT for this given that it's not really hardware, more like a
> place that the processor writes some stuff about what's going on in the
> SoC related to power management.
>

Given that there is some hardware (although just a chunk of sram) and
that the same driver is used for RPM, which we don't represent on the
mmio bus I think the proposed design makes sense.

Regards,
Bjorn

> > + # Example of rpm sleep stats
> > + - |
> > + rpm-sleep-stats@4690000 {
> > + compatible = "qcom,rpm-sleep-stats";
> > + reg = <0 0x04690000 0 0x400>;
> > + };
> > +...

2021-03-12 17:17:39

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v6 1/4] dt-bindings: Introduce SoC sleep stats bindings

On Thu 04 Feb 08:21 CST 2021, Maulik Shah wrote:

> From: Mahesh Sivasubramanian <[email protected]>
>
> Add device binding documentation for Qualcomm Technologies, Inc. (QTI)
> SoC sleep stats driver. The driver is used for displaying SoC sleep
> statistic maintained by Always On Processor or Resource Power Manager.
>
> Cc: [email protected]
> Signed-off-by: Mahesh Sivasubramanian <[email protected]>
> Signed-off-by: Lina Iyer <[email protected]>
> Signed-off-by: Maulik Shah <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>
> Reviewed-by: Bjorn Andersson <[email protected]>
> Reviewed-by: Stephen Boyd <[email protected]>
> ---
> .../bindings/soc/qcom/soc-sleep-stats.yaml | 46 ++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml
>
> diff --git a/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml b/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml
> new file mode 100644
> index 0000000..1e012ba
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml
> @@ -0,0 +1,46 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/qcom/soc-sleep-stats.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Technologies, Inc. (QTI) SoC sleep stats bindings
> +
> +maintainers:
> + - Maulik Shah <[email protected]>
> + - Lina Iyer <[email protected]>
> +
> +description:
> + Always On Processor/Resource Power Manager maintains statistics of the SoC
> + sleep modes involving powering down of the rails and oscillator clock.
> +
> + Statistics includes SoC sleep mode type, number of times low power mode were
> + entered, time of last entry, time of last exit and accumulated sleep duration.
> +
> +properties:
> + compatible:
> + enum:
> + - qcom,rpmh-sleep-stats
> + - qcom,rpm-sleep-stats
> +
> + reg:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> +
> +examples:
> + # Example of rpmh sleep stats
> + - |
> + rpmh-sleep-stats@c3f0000 {
> + compatible = "qcom,rpmh-sleep-stats";
> + reg = <0 0x0c3f0000 0 0x400>;

The example is built with #address-cells = <1> and #size-cells = <1>, so
this needs to be reg = <0x0c3f0000 0x400>.

Regards,
Bjorn

> + };
> + # Example of rpm sleep stats
> + - |
> + rpm-sleep-stats@4690000 {
> + compatible = "qcom,rpm-sleep-stats";
> + reg = <0 0x04690000 0 0x400>;
> + };
> +...
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>

2021-04-06 16:02:39

by Maulik Shah

[permalink] [raw]
Subject: Re: [PATCH v6 1/4] dt-bindings: Introduce SoC sleep stats bindings

Hi,

On 3/12/2021 10:45 PM, Bjorn Andersson wrote:
> On Thu 04 Feb 08:21 CST 2021, Maulik Shah wrote:
>
>> From: Mahesh Sivasubramanian <[email protected]>
>>
>> Add device binding documentation for Qualcomm Technologies, Inc. (QTI)
>> SoC sleep stats driver. The driver is used for displaying SoC sleep
>> statistic maintained by Always On Processor or Resource Power Manager.
>>
>> Cc: [email protected]
>> Signed-off-by: Mahesh Sivasubramanian <[email protected]>
>> Signed-off-by: Lina Iyer <[email protected]>
>> Signed-off-by: Maulik Shah <[email protected]>
>> Reviewed-by: Rob Herring <[email protected]>
>> Reviewed-by: Bjorn Andersson <[email protected]>
>> Reviewed-by: Stephen Boyd <[email protected]>
>> ---
>> .../bindings/soc/qcom/soc-sleep-stats.yaml | 46 ++++++++++++++++++++++
>> 1 file changed, 46 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml b/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml
>> new file mode 100644
>> index 0000000..1e012ba
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/soc/qcom/soc-sleep-stats.yaml
>> @@ -0,0 +1,46 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/soc/qcom/soc-sleep-stats.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Qualcomm Technologies, Inc. (QTI) SoC sleep stats bindings
>> +
>> +maintainers:
>> + - Maulik Shah <[email protected]>
>> + - Lina Iyer <[email protected]>
>> +
>> +description:
>> + Always On Processor/Resource Power Manager maintains statistics of the SoC
>> + sleep modes involving powering down of the rails and oscillator clock.
>> +
>> + Statistics includes SoC sleep mode type, number of times low power mode were
>> + entered, time of last entry, time of last exit and accumulated sleep duration.
>> +
>> +properties:
>> + compatible:
>> + enum:
>> + - qcom,rpmh-sleep-stats
>> + - qcom,rpm-sleep-stats
>> +
>> + reg:
>> + maxItems: 1
>> +
>> +required:
>> + - compatible
>> + - reg
>> +
>> +examples:
>> + # Example of rpmh sleep stats
>> + - |
>> + rpmh-sleep-stats@c3f0000 {
>> + compatible = "qcom,rpmh-sleep-stats";
>> + reg = <0 0x0c3f0000 0 0x400>;
> The example is built with #address-cells = <1> and #size-cells = <1>, so
> this needs to be reg = <0x0c3f0000 0x400>.
>
> Regards,
> Bjorn

Thanks, Fixed in v7.

Thanks,
Maulik
>
>> + };
>> + # Example of rpm sleep stats
>> + - |
>> + rpm-sleep-stats@4690000 {
>> + compatible = "qcom,rpm-sleep-stats";
>> + reg = <0 0x04690000 0 0x400>;
>> + };
>> +...
>> --
>> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
>> of Code Aurora Forum, hosted by The Linux Foundation
>>
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation