Skip to contentSkip to conversation

ARM: dts: sun8i: a83t: Add missing cooling device properties for CPUs

PATCH Applied [email protected] 2 participants 6 messages Mar 28, 2019 – Apr 1, 2019

Subsystems (2)

v2 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover ARM: dts: sun8i: a83t: Add missing cooling device properties for CPUs

From: Ondrej Jirman <megous-5qf/[email protected]>

This series adds some properties to prepare for passive cooling via CPU frequency down-regulation, and fixes cpufreq for various CPU hotplug situations.

#cooling-cells patch is not strictly necessary now, but now that SID changes are soon to be merged, thermal sensor patches are likely to follow, and it will be useful in short order, I expect.

Please take a look.

regards,
Ondrej Jirman

Changes for v2:
- split the former single patch into a series
- reformulated descriptions to accommodate the split

Ondrej Jirman (2):
ARM: dts: sun8i: a83t: Add missing cooling device properties for CPUs
ARM: dts: sun8i: a83t: Add missing CPU clock references

 arch/arm/boot/dts/sun8i-a83t.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
Signature · 1 line
2.21.0
#1 lore raw

PATCH v2 1/2 ARM: dts: sun8i: a83t: Add missing cooling device properties for CPUs

From: Ondrej Jirman <megous-5qf/[email protected]>

Enable to use CPUs as cooling device in the future, by adding "#cooling-cells" to each CPU node. This property should be present for all the CPUs of a cluster. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device.

---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +8 -0
index fcb7ef5ce2df..7a40b7d77ec0 100644
@@ -69,6 +69,7 @@
 			cci-control-port = <&cci_control0>;
 			enable-method = "allwinner,sun8i-a83t-smp";
 			reg = <0>;
+			#cooling-cells = <2>;
 		};
 
 		cpu@1 {
@@ -78,6 +79,7 @@
 			cci-control-port = <&cci_control0>;
 			enable-method = "allwinner,sun8i-a83t-smp";
 			reg = <1>;
+			#cooling-cells = <2>;
 		};
 
 		cpu@2 {
@@ -87,6 +89,7 @@
 			cci-control-port = <&cci_control0>;
 			enable-method = "allwinner,sun8i-a83t-smp";
 			reg = <2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu@3 {
@@ -96,6 +99,7 @@
 			cci-control-port = <&cci_control0>;
 			enable-method = "allwinner,sun8i-a83t-smp";
 			reg = <3>;
+			#cooling-cells = <2>;
 		};
 
 		cpu100: cpu@100 {
@@ -107,6 +111,7 @@
 			cci-control-port = <&cci_control1>;
 			enable-method = "allwinner,sun8i-a83t-smp";
 			reg = <0x100>;
+			#cooling-cells = <2>;
 		};
 
 		cpu@101 {
@@ -116,6 +121,7 @@
 			cci-control-port = <&cci_control1>;
 			enable-method = "allwinner,sun8i-a83t-smp";
 			reg = <0x101>;
+			#cooling-cells = <2>;
 		};
 
 		cpu@102 {
@@ -125,6 +131,7 @@
 			cci-control-port = <&cci_control1>;
 			enable-method = "allwinner,sun8i-a83t-smp";
 			reg = <0x102>;
+			#cooling-cells = <2>;
 		};
 
 		cpu@103 {
@@ -134,6 +141,7 @@
 			cci-control-port = <&cci_control1>;
 			enable-method = "allwinner,sun8i-a83t-smp";
 			reg = <0x103>;
+			#cooling-cells = <2>;
 		};
 	};
 
Signature · 1 line
2.21.0
#2 lore raw
Quoted 11 lines · On Thu, Mar 28, 2019 at 12:31:58PM +0100…

From: Ondrej Jirman <megous-5qf/[email protected]>

Enable to use CPUs as cooling device in the future, by adding "#cooling-cells" to each CPU node. This property should be present for all the CPUs of a cluster. If these are present only for a subset of CPUs of a cluster then things will start falling apart as soon as the CPUs are brought online in a different order. For example, this will happen because the operating system looks for such properties in the CPU node it is trying to bring up, so that it can register a cooling device.

Applied, thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#3 lore raw

PATCH v2 2/2 ARM: dts: sun8i: a83t: Add missing CPU clock references

In reply to [email protected]

From: Ondrej Jirman <megous-5qf/[email protected]>

A83T DTSI has cpu clocks defined only on the first CPU in each cluster. We can bring down any CPU in the cluster, so we need to define clock for each CPU, so that the system knows what clock to use if the first CPU is down.

---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +12 -0
index 7a40b7d77ec0..1b0b025b9250 100644
@@ -73,6 +73,8 @@
 		};
 
 		cpu@1 {
+			clocks = <&ccu CLK_C0CPUX>;
+			clock-names = "cpu";
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			operating-points-v2 = <&cpu0_opp_table>;
@@ -83,6 +85,8 @@
 		};
 
 		cpu@2 {
+			clocks = <&ccu CLK_C0CPUX>;
+			clock-names = "cpu";
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			operating-points-v2 = <&cpu0_opp_table>;
@@ -93,6 +97,8 @@
 		};
 
 		cpu@3 {
+			clocks = <&ccu CLK_C0CPUX>;
+			clock-names = "cpu";
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			operating-points-v2 = <&cpu0_opp_table>;
@@ -115,6 +121,8 @@
 		};
 
 		cpu@101 {
+			clocks = <&ccu CLK_C1CPUX>;
+			clock-names = "cpu";
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			operating-points-v2 = <&cpu1_opp_table>;
@@ -125,6 +133,8 @@
 		};
 
 		cpu@102 {
+			clocks = <&ccu CLK_C1CPUX>;
+			clock-names = "cpu";
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			operating-points-v2 = <&cpu1_opp_table>;
@@ -135,6 +145,8 @@
 		};
 
 		cpu@103 {
+			clocks = <&ccu CLK_C1CPUX>;
+			clock-names = "cpu";
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			operating-points-v2 = <&cpu1_opp_table>;
Signature · 1 line
2.21.0
#4 lore raw

Re: [PATCH v2 2/2] ARM: dts: sun8i: a83t: Add missing CPU clock references

Hi,

Quoted 17 lines · On Thu, Mar 28, 2019 at 12:31:59PM +0100…

From: Ondrej Jirman <megous-5qf/[email protected]>

A83T DTSI has cpu clocks defined only on the first CPU in each cluster. We can bring down any CPU in the cluster, so we need to define clock for each CPU, so that the system knows what clock to use if the first CPU is down.

---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +0 -0
index 7a40b7d77ec0..1b0b025b9250 100644

arch/arm/boot/dts/sun8i-a83t.dtsi line 76

Quoted 4 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +1 -0
@@ -73,6 +73,8 @@
 		};
 
 		cpu@1 {
+			clocks = <&ccu CLK_C0CPUX>;

Usually we'll have the compatible first

arch/arm/boot/dts/sun8i-a83t.dtsi line 77

Quoted 1 line
arch/arm/boot/dts/sun8i-a83t.dtsi +1 -0
+			clock-names = "cpu";

And that's not documented anywhere?

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#5 lore raw

Re: [PATCH v2 2/2] ARM: dts: sun8i: a83t: Add missing CPU clock references

Hello Maxime,

Quoted 22 lines · Maxime Ripard

Hi,

Quoted 19 lines · On Thu, Mar 28, 2019 at 12:31:59PM +0100…

From: Ondrej Jirman <megous-5qf/[email protected]>

A83T DTSI has cpu clocks defined only on the first CPU in each cluster. We can bring down any CPU in the cluster, so we need to define clock for each CPU, so that the system knows what clock to use if the first CPU is down.

---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +0 -0
index 7a40b7d77ec0..1b0b025b9250 100644
@@ -73,6 +73,8 @@
 		};
 
Quoted 4 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 76

Quoted 2 lines
arch/arm/boot/dts/sun8i-a83t.dtsi +1 -0
 		cpu@1 {
+			clocks = <&ccu CLK_C0CPUX>;

Usually we'll have the compatible first

I'll re-order it.

Quoted 3 lines

arch/arm/boot/dts/sun8i-a83t.dtsi line 77

Quoted 1 line
arch/arm/boot/dts/sun8i-a83t.dtsi +1 -0
+			clock-names = "cpu";

And that's not documented anywhere?

Cpufreq doesn't use CPU clock names, except for the mediatek cpufreq driver.

It's not docummented explicitly, except it's used as part of examples in bindings/opp/opp.txt.

I guess I can safely drop it, but other will probably keep using it, because it's part of the examples.

thank you and regards,
Ondrej

Quoted 6 lines

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com