LKML Archive on lore.kernel.org
 help / Atom feed
* [PATCH] arm64: dts: rockchip: Add idle-states to device tree for rk3399
@ 2016-07-06  8:20 Caesar Wang
  2018-08-09 20:09 ` Heiko Stuebner
  0 siblings, 1 reply; 8+ messages in thread
From: Caesar Wang @ 2016-07-06  8:20 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: dianders, linux-rockchip, cf, linux-arm-kernel, tony.xie,
	dbasehore, Caesar Wang, Rob Herring, Mark Rutland,
	Catalin Marinas, Will Deacon, Brian Norris, Jianqun Xu,
	Xing Zheng, Masahiro Yamada, David Wu, devicetree, linux-kernel

As the rk3399 ATF had been supported on ARM github [0], so we can add
idle-states for rk3399.
This patch adds idle-states bindings data collected through tests
experiments (latency and energy consumption) on rk3399 evb2 board.

You can see detail idle-states definitions on document [1].

* arm,psci-suspend-param: power_state parameter to pass to the PSCI
  suspend call.
* entry-latency: Worst case latency required to enter the idle state. The
  exit-latency may be guaranteed only after entry-latency has passed.
* min-residency: Minimum period, including preparation and entry, for a
  given idle state to be worthwhile energywise
* min-residency: Minimum period, including preparation and entry, for a
  given idle state to be worthwhile energywise.

[0]:
https://github.com/ARM-software/arm-trusted-firmware
[1]:
Documentation/devicetree/bindings/arm/psci.txt
Documentation/devicetree/bindings/arm/idle-states.txt

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
---

 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index a6dd623..12ce265 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -101,6 +101,18 @@
 			};
 		};
 
+		idle-states {
+			entry-method = "psci";
+			cpu_sleep: cpu-sleep-0 {
+				compatible = "arm,idle-state";
+				local-timer-stop;
+				arm,psci-suspend-param = <0x0010000>;
+				entry-latency-us = <350>;
+				exit-latency-us = <600>;
+				min-residency-us = <1150>;
+			};
+		};
+
 		cpu_l0: cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a53", "arm,armv8";
@@ -108,6 +120,7 @@
 			enable-method = "psci";
 			#cooling-cells = <2>; /* min followed by max */
 			clocks = <&cru ARMCLKL>;
+			cpu-idle-states = <&cpu_sleep>;
 		};
 
 		cpu_l1: cpu@1 {
@@ -116,6 +129,7 @@
 			reg = <0x0 0x1>;
 			enable-method = "psci";
 			clocks = <&cru ARMCLKL>;
+			cpu-idle-states = <&cpu_sleep>;
 		};
 
 		cpu_l2: cpu@2 {
@@ -124,6 +138,7 @@
 			reg = <0x0 0x2>;
 			enable-method = "psci";
 			clocks = <&cru ARMCLKL>;
+			cpu-idle-states = <&cpu_sleep>;
 		};
 
 		cpu_l3: cpu@3 {
@@ -132,6 +147,7 @@
 			reg = <0x0 0x3>;
 			enable-method = "psci";
 			clocks = <&cru ARMCLKL>;
+			cpu-idle-states = <&cpu_sleep>;
 		};
 
 		cpu_b0: cpu@100 {
@@ -141,6 +157,7 @@
 			enable-method = "psci";
 			#cooling-cells = <2>; /* min followed by max */
 			clocks = <&cru ARMCLKB>;
+			cpu-idle-states = <&cpu_sleep>;
 		};
 
 		cpu_b1: cpu@101 {
@@ -149,6 +166,7 @@
 			reg = <0x0 0x101>;
 			enable-method = "psci";
 			clocks = <&cru ARMCLKB>;
+			cpu-idle-states = <&cpu_sleep>;
 		};
 	};
 
-- 
1.9.1

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

* Re: [PATCH] arm64: dts: rockchip: Add idle-states to device tree for rk3399
  2016-07-06  8:20 [PATCH] arm64: dts: rockchip: Add idle-states to device tree for rk3399 Caesar Wang
@ 2018-08-09 20:09 ` Heiko Stuebner
  2018-08-12 16:24   ` Tao Huang
  0 siblings, 1 reply; 8+ messages in thread
From: Heiko Stuebner @ 2018-08-09 20:09 UTC (permalink / raw)
  To: Caesar Wang
  Cc: dianders, linux-rockchip, cf, linux-arm-kernel, tony.xie,
	dbasehore, Rob Herring, Mark Rutland, Catalin Marinas,
	Will Deacon, Brian Norris, Jianqun Xu, Xing Zheng,
	Masahiro Yamada, David Wu, devicetree, linux-kernel

Am Mittwoch, 6. Juli 2016, 10:20:54 CEST schrieb Caesar Wang:
> As the rk3399 ATF had been supported on ARM github [0], so we can add
> idle-states for rk3399.
> This patch adds idle-states bindings data collected through tests
> experiments (latency and energy consumption) on rk3399 evb2 board.
> 
> You can see detail idle-states definitions on document [1].
> 
> * arm,psci-suspend-param: power_state parameter to pass to the PSCI
>   suspend call.
> * entry-latency: Worst case latency required to enter the idle state. The
>   exit-latency may be guaranteed only after entry-latency has passed.
> * min-residency: Minimum period, including preparation and entry, for a
>   given idle state to be worthwhile energywise
> * min-residency: Minimum period, including preparation and entry, for a
>   given idle state to be worthwhile energywise.
> 
> [0]:
> https://github.com/ARM-software/arm-trusted-firmware
> [1]:
> Documentation/devicetree/bindings/arm/psci.txt
> Documentation/devicetree/bindings/arm/idle-states.txt
> 
> Signed-off-by: Caesar Wang <wxt@rock-chips.com>

Looks like this patch slipped through the cracks and nobody reposted
them over time.


>  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> index a6dd623..12ce265 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> @@ -101,6 +101,18 @@
>  			};
>  		};
>  
> +		idle-states {
> +			entry-method = "psci";
> +			cpu_sleep: cpu-sleep-0 {
> +				compatible = "arm,idle-state";
> +				local-timer-stop;
> +				arm,psci-suspend-param = <0x0010000>;
> +				entry-latency-us = <350>;
> +				exit-latency-us = <600>;
> +				min-residency-us = <1150>;

Looking at the chromeos kernel, there are some more patches adapting
this idle-state to use different timings.

There also was a cluster-idle state added for a while but that seems to
cause audio issues according to the CrOS history.

In any case, I'll try to look at this shortly.


Heiko



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

* Re: [PATCH] arm64: dts: rockchip: Add idle-states to device tree for rk3399
  2018-08-09 20:09 ` Heiko Stuebner
@ 2018-08-12 16:24   ` Tao Huang
  2018-08-13  8:25     ` Heiko Stuebner
  0 siblings, 1 reply; 8+ messages in thread
From: Tao Huang @ 2018-08-12 16:24 UTC (permalink / raw)
  To: Heiko Stuebner, Caesar Wang
  Cc: Mark Rutland, devicetree, Brian Norris, Xing Zheng,
	Masahiro Yamada, Catalin Marinas, dbasehore, Will Deacon,
	dianders, Rob Herring, linux-kernel, linux-rockchip, tony.xie,
	David Wu, cf, Jianqun Xu, linux-arm-kernel

Hi Heiko:

On 2018年08月10日 04:09, Heiko Stuebner wrote:
> Am Mittwoch, 6. Juli 2016, 10:20:54 CEST schrieb Caesar Wang:
>
>>  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 18 ++++++++++++++++++
>>  1 file changed, 18 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>> index a6dd623..12ce265 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>> @@ -101,6 +101,18 @@
>>  			};
>>  		};
>>  
>> +		idle-states {
>> +			entry-method = "psci";
>> +			cpu_sleep: cpu-sleep-0 {
>> +				compatible = "arm,idle-state";
>> +				local-timer-stop;
>> +				arm,psci-suspend-param = <0x0010000>;
>> +				entry-latency-us = <350>;
>> +				exit-latency-us = <600>;
>> +				min-residency-us = <1150>;
> Looking at the chromeos kernel, there are some more patches adapting
> this idle-state to use different timings.
Yes, we have another values. So the values of this patch are wrong.
>
> There also was a cluster-idle state added for a while but that seems to
> cause audio issues according to the CrOS history.

DMA or Audio driver should add PM_QOS_CPU_DMA_LATENCY or other methods to avoid the effects of idle.
Idle itself is good.

Thanks!


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

* Re: [PATCH] arm64: dts: rockchip: Add idle-states to device tree for rk3399
  2018-08-12 16:24   ` Tao Huang
@ 2018-08-13  8:25     ` Heiko Stuebner
  2018-08-13  8:59       ` Tao Huang
  0 siblings, 1 reply; 8+ messages in thread
From: Heiko Stuebner @ 2018-08-13  8:25 UTC (permalink / raw)
  To: Tao Huang
  Cc: Caesar Wang, Mark Rutland, devicetree, Brian Norris, Xing Zheng,
	Masahiro Yamada, Catalin Marinas, dbasehore, Will Deacon,
	dianders, Rob Herring, linux-kernel, linux-rockchip, tony.xie,
	David Wu, cf, Jianqun Xu, linux-arm-kernel

Hi Tao,

Am Sonntag, 12. August 2018, 18:24:45 CEST schrieb Tao Huang:
> On 2018年08月10日 04:09, Heiko Stuebner wrote:
> > Am Mittwoch, 6. Juli 2016, 10:20:54 CEST schrieb Caesar Wang:
> >
> >>  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 18 ++++++++++++++++++
> >>  1 file changed, 18 insertions(+)
> >>
> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> >> index a6dd623..12ce265 100644
> >> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> >> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> >> @@ -101,6 +101,18 @@
> >>  			};
> >>  		};
> >>  
> >> +		idle-states {
> >> +			entry-method = "psci";
> >> +			cpu_sleep: cpu-sleep-0 {
> >> +				compatible = "arm,idle-state";
> >> +				local-timer-stop;
> >> +				arm,psci-suspend-param = <0x0010000>;
> >> +				entry-latency-us = <350>;
> >> +				exit-latency-us = <600>;
> >> +				min-residency-us = <1150>;
> > Looking at the chromeos kernel, there are some more patches adapting
> > this idle-state to use different timings.
> Yes, we have another values. So the values of this patch are wrong.
> >
> > There also was a cluster-idle state added for a while but that seems to
> > cause audio issues according to the CrOS history.
> 
> DMA or Audio driver should add PM_QOS_CPU_DMA_LATENCY or other methods to avoid the effects of idle.
> Idle itself is good.

Thanks for the clarification. Do you know if some from Rockchip plans
on submitting a new version of the patch with changed timings and
cluster-sleep?

Otherwise I can also just pull the values from the vendor kernel so that
we get idle states in mainline as well.


Thanks
Heiko



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

* Re: [PATCH] arm64: dts: rockchip: Add idle-states to device tree for rk3399
  2018-08-13  8:25     ` Heiko Stuebner
@ 2018-08-13  8:59       ` Tao Huang
  0 siblings, 0 replies; 8+ messages in thread
From: Tao Huang @ 2018-08-13  8:59 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Caesar Wang, Mark Rutland, devicetree, Brian Norris, Xing Zheng,
	Masahiro Yamada, Catalin Marinas, dbasehore, Will Deacon,
	dianders, Rob Herring, linux-kernel, linux-rockchip, tony.xie,
	David Wu, cf, Jianqun Xu, linux-arm-kernel

On 2018年08月13日 16:25, Heiko Stuebner wrote:
> Hi Tao,
>
> Am Sonntag, 12. August 2018, 18:24:45 CEST schrieb Tao Huang:
>> On 2018年08月10日 04:09, Heiko Stuebner wrote:
>>> Am Mittwoch, 6. Juli 2016, 10:20:54 CEST schrieb Caesar Wang:
>>>
>>>>  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 18 ++++++++++++++++++
>>>>  1 file changed, 18 insertions(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>>>> index a6dd623..12ce265 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>>>> @@ -101,6 +101,18 @@
>>>>  			};
>>>>  		};
>>>>  
>>>> +		idle-states {
>>>> +			entry-method = "psci";
>>>> +			cpu_sleep: cpu-sleep-0 {
>>>> +				compatible = "arm,idle-state";
>>>> +				local-timer-stop;
>>>> +				arm,psci-suspend-param = <0x0010000>;
>>>> +				entry-latency-us = <350>;
>>>> +				exit-latency-us = <600>;
>>>> +				min-residency-us = <1150>;
>>> Looking at the chromeos kernel, there are some more patches adapting
>>> this idle-state to use different timings.
>> Yes, we have another values. So the values of this patch are wrong.
>>> There also was a cluster-idle state added for a while but that seems to
>>> cause audio issues according to the CrOS history.
>> DMA or Audio driver should add PM_QOS_CPU_DMA_LATENCY or other methods to avoid the effects of idle.
>> Idle itself is good.
> Thanks for the clarification. Do you know if some from Rockchip plans
> on submitting a new version of the patch with changed timings and
> cluster-sleep?

Okay. I will arrange engineer to submit the patch.


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

* Re: [PATCH] arm64: dts: rockchip: Add idle-states to device tree for rk3399
  2018-08-24 10:03 ` Tony Xie
@ 2018-08-29 12:49   ` Heiko Stuebner
  0 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2018-08-29 12:49 UTC (permalink / raw)
  To: Tony Xie
  Cc: robh+dt, mark.rutland, linux-arm-kernel, linux-rockchip,
	devicetree, linux-kernel, chenjh, xsf, zhangqing, huangtao

Hi Tony,

Am Freitag, 24. August 2018, 12:03:00 CEST schrieb Tony Xie:
> Signed-off-by: Tony Xie <tony.xie@rock-chips.com>

I've added a commit message and applied the patch for 4.20.


Thanks
Heiko




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

* [PATCH] arm64: dts: rockchip: Add idle-states to device tree for rk3399
  2018-08-24 10:02 Tony Xie
@ 2018-08-24 10:03 ` Tony Xie
  2018-08-29 12:49   ` Heiko Stuebner
  0 siblings, 1 reply; 8+ messages in thread
From: Tony Xie @ 2018-08-24 10:03 UTC (permalink / raw)
  To: heiko
  Cc: robh+dt, mark.rutland, linux-arm-kernel, linux-rockchip,
	devicetree, linux-kernel, chenjh, xsf, zhangqing, huangtao,
	tony.xie

Signed-off-by: Tony Xie <tony.xie@rock-chips.com>
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index e0040b6..49fb57f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -111,6 +111,7 @@
 			#cooling-cells = <2>; /* min followed by max */
 			clocks = <&cru ARMCLKL>;
 			dynamic-power-coefficient = <100>;
+			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
 		};
 
 		cpu_l1: cpu@1 {
@@ -120,6 +121,7 @@
 			enable-method = "psci";
 			clocks = <&cru ARMCLKL>;
 			dynamic-power-coefficient = <100>;
+			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
 		};
 
 		cpu_l2: cpu@2 {
@@ -129,6 +131,7 @@
 			enable-method = "psci";
 			clocks = <&cru ARMCLKL>;
 			dynamic-power-coefficient = <100>;
+			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
 		};
 
 		cpu_l3: cpu@3 {
@@ -138,6 +141,7 @@
 			enable-method = "psci";
 			clocks = <&cru ARMCLKL>;
 			dynamic-power-coefficient = <100>;
+			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
 		};
 
 		cpu_b0: cpu@100 {
@@ -148,6 +152,7 @@
 			#cooling-cells = <2>; /* min followed by max */
 			clocks = <&cru ARMCLKB>;
 			dynamic-power-coefficient = <436>;
+			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
 		};
 
 		cpu_b1: cpu@101 {
@@ -157,6 +162,29 @@
 			enable-method = "psci";
 			clocks = <&cru ARMCLKB>;
 			dynamic-power-coefficient = <436>;
+			cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
+		};
+
+		idle-states {
+			entry-method = "psci";
+
+			CPU_SLEEP: cpu-sleep {
+				compatible = "arm,idle-state";
+				local-timer-stop;
+				arm,psci-suspend-param = <0x0010000>;
+				entry-latency-us = <120>;
+				exit-latency-us = <250>;
+				min-residency-us = <900>;
+			};
+
+			CLUSTER_SLEEP: cluster-sleep {
+				compatible = "arm,idle-state";
+				local-timer-stop;
+				arm,psci-suspend-param = <0x1010000>;
+				entry-latency-us = <400>;
+				exit-latency-us = <500>;
+				min-residency-us = <2000>;
+			};
 		};
 	};
 
-- 
1.9.1



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

* [PATCH] arm64: dts: rockchip: Add idle-states to device tree for rk3399
@ 2018-08-24 10:02 Tony Xie
  2018-08-24 10:03 ` Tony Xie
  0 siblings, 1 reply; 8+ messages in thread
From: Tony Xie @ 2018-08-24 10:02 UTC (permalink / raw)
  To: heiko
  Cc: robh+dt, mark.rutland, linux-arm-kernel, linux-rockchip,
	devicetree, linux-kernel, chenjh, xsf, zhangqing, huangtao,
	tony.xie

Tony Xie (1):
  arm64: dts: rockchip: Add idle-states to device tree for rk3399

 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

-- 
1.9.1



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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-06  8:20 [PATCH] arm64: dts: rockchip: Add idle-states to device tree for rk3399 Caesar Wang
2018-08-09 20:09 ` Heiko Stuebner
2018-08-12 16:24   ` Tao Huang
2018-08-13  8:25     ` Heiko Stuebner
2018-08-13  8:59       ` Tao Huang
2018-08-24 10:02 Tony Xie
2018-08-24 10:03 ` Tony Xie
2018-08-29 12:49   ` Heiko Stuebner

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox