All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Lina Iyer <lina.iyer@linaro.org>
Cc: devicetree@vger.kernel.org, ulf.hansson@linaro.org,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
	Juri Lelli <Juri.Lelli@arm.com>,
	khilman@kernel.org, sboyd@codeaurora.org,
	linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
	rjw@rjwysocki.net, Brendan Jackman <Brendan.Jackman@arm.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	andy.gross@linaro.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 15/15] ARM64: dts: Define CPU power domain for MSM8916
Date: Thu, 11 Aug 2016 10:30:57 +0100	[thread overview]
Message-ID: <3307b0e2-5ad3-8e56-05e6-ed0297a0b8ce@arm.com> (raw)
In-Reply-To: <20160810173543.GB1401@linaro.org>



On 10/08/16 18:35, Lina Iyer wrote:
> On Wed, Aug 10 2016 at 09:27 -0600, Sudeep Holla wrote:
>>
>>
>> On 05/08/16 00:05, Lina Iyer wrote:
>>> Define power domain and the power states for the domain as defined by
>>> the PSCI firmware.
>>
>>> The 8916 firmware supports OS initiated method of
>>> powering off the CPU clusters.
>>
>> How is that related to the this DTS change, more details below ?
>>
>>>
>>> Cc: <devicetree@vger.kernel.org>
>>> Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
>>> ---
>>> arch/arm64/boot/dts/qcom/msm8916.dtsi | 27 +++++++++++++++++++++++++++
>>> 1 file changed, 27 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> b/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> index 3029773..eb0aaed 100644
>>> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> @@ -64,6 +64,7 @@
>>>             next-level-cache = <&L2_0>;
>>>             enable-method = "psci";
>>>             cpu-idle-states = <&CPU_SPC>;
>>> +            power-domains = <&CPU_PD>;
>>
>> This is really messy. We need to have idle state information at one
>> place. I prefer to have a hierarchal representation of power-domains
>> for CPU with idle-states at each level.
>>
>>>         };
> I see where are going with that. We need to then isolate idle states
> from all devices (including CPU) and put them under the umberella of the
> domain/parent idle states.
>
> We also need to remember that domain idle states are not just for CPU
> domains. There are generic PM domains that also define their idle
> states. For some, that hierarchy may not make sense. So forcing it on
> all domains is not correct as well.
>

Yes again I absolutely agree with that. But just represent the hierarchy
present in the hardware in the DT. If it doesn't exist in the hardware
for some device, then it won't be represented.

>>>
>>>         CPU1: cpu@1 {
>>> @@ -73,6 +74,7 @@
>>>             next-level-cache = <&L2_0>;
>>>             enable-method = "psci";
>>>             cpu-idle-states = <&CPU_SPC>;
>>> +            power-domains = <&CPU_PD>;
>>>         };
>>>
>>>         CPU2: cpu@2 {
>>> @@ -82,6 +84,7 @@
>>>             next-level-cache = <&L2_0>;
>>>             enable-method = "psci";
>>>             cpu-idle-states = <&CPU_SPC>;
>>> +            power-domains = <&CPU_PD>;
>>>         };
>>>
>>>         CPU3: cpu@3 {
>>> @@ -91,6 +94,7 @@
>>>             next-level-cache = <&L2_0>;
>>>             enable-method = "psci";
>>>             cpu-idle-states = <&CPU_SPC>;
>>> +            power-domains = <&CPU_PD>;
>>>         };
>>>
>>>         L2_0: l2-cache {
>>> @@ -113,6 +117,29 @@
>>>     psci {
>>>         compatible = "arm,psci-1.0";
>>>         method = "smc";
>>
>> Why is it inside PSCI node ? I don't see a need for that.
>> If it needs to be here, then amend the binding document.
>>
> It is described in patch 13/15.
>
> It is inside PSCI node, because PSCI has the domain controller.
>

OK, I haven't gone through all the patches, I was just interested in
the binding. Sorry for that.

>>> +
>>> +        CPU_PD: cpu-pd@0 {
>>> +            #power-domain-cells = <0>;
>>> +            domain-idle-states = <&CLUSTER_RET>, <&CLUSTER_PWR_DWN>;
>>> +        };
>>> +
>>> +        domain-states {
>>> +            CLUSTER_RET: domain_ret {
>>> +                compatible = "arm,idle-state";
>>> +                arm,psci-suspend-param = <0x1000010>;
>>> +                entry-latency-us = <500>;
>>> +                exit-latency-us = <500>;
>>> +                min-residency-us = <2000>;
>>> +            };
>>> +
>>> +            CLUSTER_PWR_DWN: domain_gdhs {
>>> +                compatible = "arm,idle-state";
>>> +                arm,psci-suspend-param = <0x1000030>;
>>> +                entry-latency-us = <2000>;
>>> +                exit-latency-us = <2000>;
>>> +                min-residency-us = <6000>;
>>> +            };
>>> +        };
>>
>> So how do you collapse these states into the cpu level states ?
> Why do you have to collapse?
>

To deal with platform co-ordinated mode of cpu idle support. I think I
gave an example in the other email.

>> We should be able to cope up with platform co-ordinated mode of idle.
>> For me, this binding and the representation here is designed only to
>> address OS co-ordinated mode of idle support but it should be other way
>> around. Design the bindings that can cater any mode (platform and OS
>> co-ordinated)
> As explained to Brendan on the version2 of the series, OSI and PC are
> orthagonal to each other. The idle state definition in the devicetree
> exactly matches the unique approaches of these 2 modes.
>

We don't design bindings that depend on the software approaches or
configurations. It should represent the hardware.

> In platform coordinated, the CPU determines the idle state of the domain
> and selects the state, hence it makes sense to extend the
> cpu-idle-states to cover those domain states.
>

So, are you saying that old bindings are for platform co-ordinated mode
and these new ones are for OS co-ordinated mode. Make it clear in the
binding document and get explicit approval from the DT maintainers for
that. I really don't like that approach.

> In OSI, the CPUs only determine their idle states. When they are done
> with their idle state, they bubble up and let the domain choose its idle
> state and therefore the domain-idle-states is part of the domain
> controller.
>

I understand that, but I don't like the approach taken to define the DT
bindings. DT should have one or the other form and any mode can be used
as long as firmware is queried and put into appropriate mode of operation.

> With this addition platform coordinated representation is not broken. If
> your SoC supports both platform and os modes, then you can specify the
> idle states of both of them in the DT. The clause in firmware/psci.c
> will however, choose OSI if its available. I am not sure we want to
> dynamically switch betweeen OSI and PC at runtime.
>

How ? cpu-idle-states in CPU node can't have both:
1. just it's idles states, and
2. complete list of flattened idle states as it' is present today.

-- 
Regards,
Sudeep

WARNING: multiple messages have this Message-ID (diff)
From: sudeep.holla@arm.com (Sudeep Holla)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 15/15] ARM64: dts: Define CPU power domain for MSM8916
Date: Thu, 11 Aug 2016 10:30:57 +0100	[thread overview]
Message-ID: <3307b0e2-5ad3-8e56-05e6-ed0297a0b8ce@arm.com> (raw)
In-Reply-To: <20160810173543.GB1401@linaro.org>



On 10/08/16 18:35, Lina Iyer wrote:
> On Wed, Aug 10 2016 at 09:27 -0600, Sudeep Holla wrote:
>>
>>
>> On 05/08/16 00:05, Lina Iyer wrote:
>>> Define power domain and the power states for the domain as defined by
>>> the PSCI firmware.
>>
>>> The 8916 firmware supports OS initiated method of
>>> powering off the CPU clusters.
>>
>> How is that related to the this DTS change, more details below ?
>>
>>>
>>> Cc: <devicetree@vger.kernel.org>
>>> Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
>>> ---
>>> arch/arm64/boot/dts/qcom/msm8916.dtsi | 27 +++++++++++++++++++++++++++
>>> 1 file changed, 27 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> b/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> index 3029773..eb0aaed 100644
>>> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> @@ -64,6 +64,7 @@
>>>             next-level-cache = <&L2_0>;
>>>             enable-method = "psci";
>>>             cpu-idle-states = <&CPU_SPC>;
>>> +            power-domains = <&CPU_PD>;
>>
>> This is really messy. We need to have idle state information at one
>> place. I prefer to have a hierarchal representation of power-domains
>> for CPU with idle-states at each level.
>>
>>>         };
> I see where are going with that. We need to then isolate idle states
> from all devices (including CPU) and put them under the umberella of the
> domain/parent idle states.
>
> We also need to remember that domain idle states are not just for CPU
> domains. There are generic PM domains that also define their idle
> states. For some, that hierarchy may not make sense. So forcing it on
> all domains is not correct as well.
>

Yes again I absolutely agree with that. But just represent the hierarchy
present in the hardware in the DT. If it doesn't exist in the hardware
for some device, then it won't be represented.

>>>
>>>         CPU1: cpu at 1 {
>>> @@ -73,6 +74,7 @@
>>>             next-level-cache = <&L2_0>;
>>>             enable-method = "psci";
>>>             cpu-idle-states = <&CPU_SPC>;
>>> +            power-domains = <&CPU_PD>;
>>>         };
>>>
>>>         CPU2: cpu at 2 {
>>> @@ -82,6 +84,7 @@
>>>             next-level-cache = <&L2_0>;
>>>             enable-method = "psci";
>>>             cpu-idle-states = <&CPU_SPC>;
>>> +            power-domains = <&CPU_PD>;
>>>         };
>>>
>>>         CPU3: cpu at 3 {
>>> @@ -91,6 +94,7 @@
>>>             next-level-cache = <&L2_0>;
>>>             enable-method = "psci";
>>>             cpu-idle-states = <&CPU_SPC>;
>>> +            power-domains = <&CPU_PD>;
>>>         };
>>>
>>>         L2_0: l2-cache {
>>> @@ -113,6 +117,29 @@
>>>     psci {
>>>         compatible = "arm,psci-1.0";
>>>         method = "smc";
>>
>> Why is it inside PSCI node ? I don't see a need for that.
>> If it needs to be here, then amend the binding document.
>>
> It is described in patch 13/15.
>
> It is inside PSCI node, because PSCI has the domain controller.
>

OK, I haven't gone through all the patches, I was just interested in
the binding. Sorry for that.

>>> +
>>> +        CPU_PD: cpu-pd at 0 {
>>> +            #power-domain-cells = <0>;
>>> +            domain-idle-states = <&CLUSTER_RET>, <&CLUSTER_PWR_DWN>;
>>> +        };
>>> +
>>> +        domain-states {
>>> +            CLUSTER_RET: domain_ret {
>>> +                compatible = "arm,idle-state";
>>> +                arm,psci-suspend-param = <0x1000010>;
>>> +                entry-latency-us = <500>;
>>> +                exit-latency-us = <500>;
>>> +                min-residency-us = <2000>;
>>> +            };
>>> +
>>> +            CLUSTER_PWR_DWN: domain_gdhs {
>>> +                compatible = "arm,idle-state";
>>> +                arm,psci-suspend-param = <0x1000030>;
>>> +                entry-latency-us = <2000>;
>>> +                exit-latency-us = <2000>;
>>> +                min-residency-us = <6000>;
>>> +            };
>>> +        };
>>
>> So how do you collapse these states into the cpu level states ?
> Why do you have to collapse?
>

To deal with platform co-ordinated mode of cpu idle support. I think I
gave an example in the other email.

>> We should be able to cope up with platform co-ordinated mode of idle.
>> For me, this binding and the representation here is designed only to
>> address OS co-ordinated mode of idle support but it should be other way
>> around. Design the bindings that can cater any mode (platform and OS
>> co-ordinated)
> As explained to Brendan on the version2 of the series, OSI and PC are
> orthagonal to each other. The idle state definition in the devicetree
> exactly matches the unique approaches of these 2 modes.
>

We don't design bindings that depend on the software approaches or
configurations. It should represent the hardware.

> In platform coordinated, the CPU determines the idle state of the domain
> and selects the state, hence it makes sense to extend the
> cpu-idle-states to cover those domain states.
>

So, are you saying that old bindings are for platform co-ordinated mode
and these new ones are for OS co-ordinated mode. Make it clear in the
binding document and get explicit approval from the DT maintainers for
that. I really don't like that approach.

> In OSI, the CPUs only determine their idle states. When they are done
> with their idle state, they bubble up and let the domain choose its idle
> state and therefore the domain-idle-states is part of the domain
> controller.
>

I understand that, but I don't like the approach taken to define the DT
bindings. DT should have one or the other form and any mode can be used
as long as firmware is queried and put into appropriate mode of operation.

> With this addition platform coordinated representation is not broken. If
> your SoC supports both platform and os modes, then you can specify the
> idle states of both of them in the DT. The clause in firmware/psci.c
> will however, choose OSI if its available. I am not sure we want to
> dynamically switch betweeen OSI and PC at runtime.
>

How ? cpu-idle-states in CPU node can't have both:
1. just it's idles states, and
2. complete list of flattened idle states as it' is present today.

-- 
Regards,
Sudeep

  reply	other threads:[~2016-08-11  9:30 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04 23:04 [PATCH v3 00/15] PM: SoC idle support using PM domains Lina Iyer
2016-08-04 23:04 ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 01/15] PM / Domains: Allow domain power states to be read from DT Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 02/15] dt/bindings: Update binding for PM domain idle states Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-09 23:55   ` Rob Herring
2016-08-09 23:55     ` Rob Herring
2016-08-10 15:14   ` Sudeep Holla
2016-08-10 15:14     ` Sudeep Holla
2016-08-10 16:40     ` Lina Iyer
2016-08-10 16:40       ` Lina Iyer
     [not found]       ` <20160810164034.GA1401-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-10 18:09         ` Sudeep Holla
2016-08-10 18:09           ` Sudeep Holla
2016-08-10 18:13           ` Sudeep Holla
2016-08-10 18:13             ` Sudeep Holla
     [not found]           ` <5e59874c-bbb7-270a-199c-da1ff5932554-5wv7dgnIgG8@public.gmane.org>
2016-08-11 21:10             ` Lina Iyer
2016-08-11 21:10               ` Lina Iyer
     [not found]               ` <20160811211023.GC1401-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-12  9:47                 ` Brendan Jackman
2016-08-12  9:47                   ` Brendan Jackman
2016-08-12 10:08               ` Sudeep Holla
2016-08-12 10:08                 ` Sudeep Holla
2016-08-15 16:08                 ` Lina Iyer
2016-08-15 16:08                   ` Lina Iyer
2016-08-15 16:14                   ` Sudeep Holla
2016-08-15 16:14                     ` Sudeep Holla
2016-08-15 22:40                     ` Lina Iyer
2016-08-15 22:40                       ` Lina Iyer
     [not found]                       ` <20160815224014.GF1401-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-16  8:34                         ` Brendan Jackman
2016-08-16  8:34                           ` Brendan Jackman
2016-08-16  8:41                       ` Brendan Jackman
2016-08-16  8:41                         ` Brendan Jackman
2016-08-16  9:19                         ` Sudeep Holla
2016-08-16  9:19                           ` Sudeep Holla
2016-08-12 12:35               ` Brendan Jackman
2016-08-12 12:35                 ` Brendan Jackman
2016-08-15 16:06                 ` Lina Iyer
2016-08-15 16:06                   ` Lina Iyer
2016-08-19 18:10           ` Kevin Hilman
2016-08-19 18:10             ` Kevin Hilman
2016-08-24 14:07             ` Sudeep Holla
2016-08-24 14:07               ` Sudeep Holla
     [not found]   ` <1470351902-43103-3-git-send-email-lina.iyer-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-24 13:48     ` [RFC 0/6] Illustration of using domain-idle-states for CPU " Brendan Jackman
2016-08-24 13:48       ` [RFC 1/6] cpuidle: Rename cpuidle_get_{cpu->dev}_driver Brendan Jackman
2016-08-24 13:48       ` [RFC 2/6] cpuidle: Add public funcion to get driver from CPU index Brendan Jackman
     [not found]       ` <20160824134822.3591-1-brendan.jackman-5wv7dgnIgG8@public.gmane.org>
2016-08-24 13:48         ` [RFC 3/6] cpuidle: Add device_node pointer in cpuidle_state Brendan Jackman
2016-08-24 13:48         ` [RFC 6/6] arm64: dts: Add domain-idle-states for Juno r0 power domains Brendan Jackman
2016-08-24 13:48       ` [RFC 4/6] cpuidle: dt: Add support for reading states from " Brendan Jackman
2016-08-24 13:48       ` [RFC 5/6] arm64: dts: Add Juno r0 CPU power domain tree Brendan Jackman
2016-08-04 23:04 ` [PATCH v3 03/15] PM / Domains: Abstract genpd locking Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 04/15] PM / Domains: Support IRQ safe PM domains Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 05/15] PM / doc: Update device documentation for devices in " Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 06/15] PM / cpu_domains: Setup PM domains for CPUs/clusters Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 07/15] ARM: cpuidle: Add runtime PM support for CPUs Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 08/15] timer: Export next wake up of a CPU Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 09/15] PM / cpu_domains: Add PM Domain governor for CPUs Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 10/15] doc / cpu_domains: Describe CPU PM domains setup and governor Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 11/15] drivers: firmware: psci: Allow OS Initiated suspend mode Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:04 ` [PATCH v3 12/15] drivers: firmware: psci: Support cluster idle states for OS-Initiated Lina Iyer
2016-08-04 23:04   ` Lina Iyer
2016-08-04 23:05 ` [PATCH v3 13/15] dt/bindings: Add PSCI OS-Initiated PM Domains bindings Lina Iyer
2016-08-04 23:05   ` Lina Iyer
2016-08-05 14:44   ` Lina Iyer
2016-08-05 14:44     ` Lina Iyer
2016-08-04 23:05 ` [PATCH v3 14/15] ARM64: dts: Add PSCI cpuidle support for MSM8916 Lina Iyer
2016-08-04 23:05   ` Lina Iyer
     [not found] ` <1470351902-43103-1-git-send-email-lina.iyer-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-04 23:05   ` [PATCH v3 15/15] ARM64: dts: Define CPU power domain " Lina Iyer
2016-08-04 23:05     ` Lina Iyer
2016-08-10 15:27     ` Sudeep Holla
2016-08-10 15:27       ` Sudeep Holla
2016-08-10 17:35       ` Lina Iyer
2016-08-10 17:35         ` Lina Iyer
2016-08-11  9:30         ` Sudeep Holla [this message]
2016-08-11  9:30           ` Sudeep Holla

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=3307b0e2-5ad3-8e56-05e6-ed0297a0b8ce@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=Brendan.Jackman@arm.com \
    --cc=Juri.Lelli@arm.com \
    --cc=Lorenzo.Pieralisi@arm.com \
    --cc=andy.gross@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=khilman@kernel.org \
    --cc=lina.iyer@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.org \
    --cc=ulf.hansson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.