linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/2] ARM: dts: sun8i-r40: add opp table for cpu
@ 2022-05-12  7:18 qianfanguijin
  2022-05-12  7:18 ` [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board qianfanguijin
  2022-05-12  7:29 ` [PATCH v3 1/2] ARM: dts: sun8i-r40: add opp table for cpu Viresh Kumar
  0 siblings, 2 replies; 9+ messages in thread
From: qianfanguijin @ 2022-05-12  7:18 UTC (permalink / raw)
  To: linux-sunxi
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec,
	Rafael J . Wysocki, Viresh Kumar, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm, qianfan Zhao

From: qianfan Zhao <qianfanguijin@163.com>

OPP table value is get from allwinner lichee linux-3.10 kernel driver

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
---
Changes in v3:
- remove "allwinner-r40" compatible from allowlist.
- split dts in two part.

 arch/arm/boot/dts/sun8i-r40.dtsi | 47 ++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 291f4784e86c..90de119095fa 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -54,6 +54,41 @@ / {
 	#size-cells = <1>;
 	interrupt-parent = <&gic>;
 
+	cpu0_opp_table: opp_table0 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp-720000000 {
+			opp-hz = /bits/ 64 <720000000>;
+			opp-microvolt = <1000000 1000000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-912000000 {
+			opp-hz = /bits/ 64 <912000000>;
+			opp-microvolt = <1100000 1100000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-1008000000 {
+			opp-hz = /bits/ 64 <1008000000>;
+			opp-microvolt = <1160000 1160000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-1104000000 {
+			opp-hz = /bits/ 64 <1104000000>;
+			opp-microvolt = <1240000 1240000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+
+		opp-1200000000 {
+			opp-hz = /bits/ 64 <1200000000>;
+			opp-microvolt = <1300000 1300000 1300000>;
+			clock-latency-ns = <2000000>;
+		};
+	};
+
 	clocks {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -84,24 +119,36 @@ cpu0: cpu@0 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <0>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 
 		cpu1: cpu@1 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <1>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 
 		cpu2: cpu@2 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <2>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 
 		cpu3: cpu@3 {
 			compatible = "arm,cortex-a7";
 			device_type = "cpu";
 			reg = <3>;
+			clocks = <&ccu CLK_CPU>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
 		};
 	};
 
-- 
2.25.1


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

* [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board
  2022-05-12  7:18 [PATCH v3 1/2] ARM: dts: sun8i-r40: add opp table for cpu qianfanguijin
@ 2022-05-12  7:18 ` qianfanguijin
  2022-05-13  7:38   ` Maxime Ripard
  2022-05-12  7:29 ` [PATCH v3 1/2] ARM: dts: sun8i-r40: add opp table for cpu Viresh Kumar
  1 sibling, 1 reply; 9+ messages in thread
From: qianfanguijin @ 2022-05-12  7:18 UTC (permalink / raw)
  To: linux-sunxi
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec,
	Rafael J . Wysocki, Viresh Kumar, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm, qianfan Zhao

From: qianfan Zhao <qianfanguijin@163.com>

sun8i-r40 actived cpufreq feature now, let's add "cpu-supply" node on
board.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
---
 arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 4 ++++
 arch/arm/boot/dts/sun8i-r40-feta40i.dtsi          | 4 ++++
 arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts          | 4 ++++
 arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 4 ++++
 4 files changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
index a6a1087a0c9b..4f30018ec4a2 100644
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -113,6 +113,10 @@ &ahci {
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
index 265e0fa57a32..b872b51a346d 100644
--- a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
@@ -6,6 +6,10 @@
 
 #include "sun8i-r40.dtsi"
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &i2c0 {
 	status = "okay";
 
diff --git a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
index 6931aaab2382..0eb1990742ff 100644
--- a/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
+++ b/arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
@@ -88,6 +88,10 @@ &ahci {
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index 47954551f573..fdf8bd12faaa 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -107,6 +107,10 @@ &ahci {
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
 	status = "okay";
 };
-- 
2.25.1


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

* Re: [PATCH v3 1/2] ARM: dts: sun8i-r40: add opp table for cpu
  2022-05-12  7:18 [PATCH v3 1/2] ARM: dts: sun8i-r40: add opp table for cpu qianfanguijin
  2022-05-12  7:18 ` [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board qianfanguijin
@ 2022-05-12  7:29 ` Viresh Kumar
  1 sibling, 0 replies; 9+ messages in thread
From: Viresh Kumar @ 2022-05-12  7:29 UTC (permalink / raw)
  To: qianfanguijin
  Cc: linux-sunxi, Rob Herring, Maxime Ripard, Chen-Yu Tsai,
	Jernej Skrabec, Rafael J . Wysocki, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm

On 12-05-22, 15:18, qianfanguijin@163.com wrote:
> From: qianfan Zhao <qianfanguijin@163.com>
> 
> OPP table value is get from allwinner lichee linux-3.10 kernel driver
> 
> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
> ---
> Changes in v3:
> - remove "allwinner-r40" compatible from allowlist.
> - split dts in two part.
> 
>  arch/arm/boot/dts/sun8i-r40.dtsi | 47 ++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)

Both the patches can go via SoC tree now. I will not pick them. Thanks.

-- 
viresh

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

* Re: [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board
  2022-05-12  7:18 ` [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board qianfanguijin
@ 2022-05-13  7:38   ` Maxime Ripard
  2022-05-13  7:48     ` qianfan
  0 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2022-05-13  7:38 UTC (permalink / raw)
  To: qianfanguijin
  Cc: linux-sunxi, Rob Herring, Chen-Yu Tsai, Jernej Skrabec,
	Rafael J . Wysocki, Viresh Kumar, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 1619 bytes --]

Hi,

On Thu, May 12, 2022 at 03:18:58PM +0800, qianfanguijin@163.com wrote:
> From: qianfan Zhao <qianfanguijin@163.com>
> 
> sun8i-r40 actived cpufreq feature now, let's add "cpu-supply" node on
> board.
> 
> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
> ---
>  arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 4 ++++
>  arch/arm/boot/dts/sun8i-r40-feta40i.dtsi          | 4 ++++
>  arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts          | 4 ++++
>  arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 4 ++++
>  4 files changed, 16 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> index a6a1087a0c9b..4f30018ec4a2 100644
> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> @@ -113,6 +113,10 @@ &ahci {
>  	status = "okay";
>  };
>  
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +

This will break bisection on those boards. Indeed, you added the OPPs on
the first patch, and if you only apply that patch, the boards in the
second patch will be missing their CPU regulator. The kernel will then
ramp up the frequency to the highest OPP, but will not change the
voltage, resulting in a crash.

There's a similar issue for all the boards that don't have a regulator
in the first place.

The way we worked around this for the other SoCs is to have a DTSI with
the OPPs with a frequency higher than what U-Boot boots with (1008MHz?),
and only include that DTSI on boards that have a CPU regulator hooked in.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board
  2022-05-13  7:38   ` Maxime Ripard
@ 2022-05-13  7:48     ` qianfan
  2022-05-13  8:15       ` Maxime Ripard
  0 siblings, 1 reply; 9+ messages in thread
From: qianfan @ 2022-05-13  7:48 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: linux-sunxi, Rob Herring, Chen-Yu Tsai, Jernej Skrabec,
	Rafael J . Wysocki, Viresh Kumar, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm



在 2022/5/13 15:38, Maxime Ripard 写道:
> Hi,
>
> On Thu, May 12, 2022 at 03:18:58PM +0800, qianfanguijin@163.com wrote:
>> From: qianfan Zhao <qianfanguijin@163.com>
>>
>> sun8i-r40 actived cpufreq feature now, let's add "cpu-supply" node on
>> board.
>>
>> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
>> ---
>>   arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 4 ++++
>>   arch/arm/boot/dts/sun8i-r40-feta40i.dtsi          | 4 ++++
>>   arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts          | 4 ++++
>>   arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 4 ++++
>>   4 files changed, 16 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> index a6a1087a0c9b..4f30018ec4a2 100644
>> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>> @@ -113,6 +113,10 @@ &ahci {
>>   	status = "okay";
>>   };
>>   
>> +&cpu0 {
>> +	cpu-supply = <&reg_dcdc2>;
>> +};
>> +
> This will break bisection on those boards. Indeed, you added the OPPs on
> the first patch, and if you only apply that patch, the boards in the
> second patch will be missing their CPU regulator. The kernel will then
> ramp up the frequency to the highest OPP, but will not change the
> voltage, resulting in a crash.
This is a good point and I will merge those two patch.
>
> There's a similar issue for all the boards that don't have a regulator
> in the first place.
>
> The way we worked around this for the other SoCs is to have a DTSI with
> the OPPs with a frequency higher than what U-Boot boots with (1008MHz?),
> and only include that DTSI on boards that have a CPU regulator hooked in.
Is this really necessary? It seems like every board based on sun8i-r40
have a cpu regulator.
>
> Maxime


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

* Re: [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board
  2022-05-13  7:48     ` qianfan
@ 2022-05-13  8:15       ` Maxime Ripard
  2022-05-13  8:23         ` qianfan
  0 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2022-05-13  8:15 UTC (permalink / raw)
  To: qianfan
  Cc: linux-sunxi, Rob Herring, Chen-Yu Tsai, Jernej Skrabec,
	Rafael J . Wysocki, Viresh Kumar, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 2438 bytes --]

On Fri, May 13, 2022 at 03:48:50PM +0800, qianfan wrote:
> 
> 
> 在 2022/5/13 15:38, Maxime Ripard 写道:
> > Hi,
> > 
> > On Thu, May 12, 2022 at 03:18:58PM +0800, qianfanguijin@163.com wrote:
> > > From: qianfan Zhao <qianfanguijin@163.com>
> > > 
> > > sun8i-r40 actived cpufreq feature now, let's add "cpu-supply" node on
> > > board.
> > > 
> > > Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
> > > ---
> > >   arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 4 ++++
> > >   arch/arm/boot/dts/sun8i-r40-feta40i.dtsi          | 4 ++++
> > >   arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts          | 4 ++++
> > >   arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 4 ++++
> > >   4 files changed, 16 insertions(+)
> > > 
> > > diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> > > index a6a1087a0c9b..4f30018ec4a2 100644
> > > --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> > > +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
> > > @@ -113,6 +113,10 @@ &ahci {
> > >   	status = "okay";
> > >   };
> > > +&cpu0 {
> > > +	cpu-supply = <&reg_dcdc2>;
> > > +};
> > > +
> > This will break bisection on those boards. Indeed, you added the OPPs on
> > the first patch, and if you only apply that patch, the boards in the
> > second patch will be missing their CPU regulator. The kernel will then
> > ramp up the frequency to the highest OPP, but will not change the
> > voltage, resulting in a crash.
>
> This is a good point and I will merge those two patch.

That's not what I meant to say. Those two patches are great separated.
You can invert them though.

> > There's a similar issue for all the boards that don't have a regulator
> > in the first place.
> > 
> > The way we worked around this for the other SoCs is to have a DTSI with
> > the OPPs with a frequency higher than what U-Boot boots with (1008MHz?),
> > and only include that DTSI on boards that have a CPU regulator hooked in.
>
> Is this really necessary? It seems like every board based on sun8i-r40
> have a cpu regulator.

This probably won't be the case whenever someone starts a new design,
and then they'll face random crashes for no apparent reason, and waste a
lot of time in the process.

Whereas the alternative is that you would be missing some OPPs,
something that is fairly easy to figure out.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board
  2022-05-13  8:15       ` Maxime Ripard
@ 2022-05-13  8:23         ` qianfan
  2022-05-16  7:53           ` Maxime Ripard
  0 siblings, 1 reply; 9+ messages in thread
From: qianfan @ 2022-05-13  8:23 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: linux-sunxi, Rob Herring, Chen-Yu Tsai, Jernej Skrabec,
	Rafael J . Wysocki, Viresh Kumar, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm



在 2022/5/13 16:15, Maxime Ripard 写道:
> On Fri, May 13, 2022 at 03:48:50PM +0800, qianfan wrote:
>>
>> 在 2022/5/13 15:38, Maxime Ripard 写道:
>>> Hi,
>>>
>>> On Thu, May 12, 2022 at 03:18:58PM +0800, qianfanguijin@163.com wrote:
>>>> From: qianfan Zhao <qianfanguijin@163.com>
>>>>
>>>> sun8i-r40 actived cpufreq feature now, let's add "cpu-supply" node on
>>>> board.
>>>>
>>>> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
>>>> ---
>>>>    arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 4 ++++
>>>>    arch/arm/boot/dts/sun8i-r40-feta40i.dtsi          | 4 ++++
>>>>    arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts          | 4 ++++
>>>>    arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 4 ++++
>>>>    4 files changed, 16 insertions(+)
>>>>
>>>> diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>>>> index a6a1087a0c9b..4f30018ec4a2 100644
>>>> --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>>>> +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
>>>> @@ -113,6 +113,10 @@ &ahci {
>>>>    	status = "okay";
>>>>    };
>>>> +&cpu0 {
>>>> +	cpu-supply = <&reg_dcdc2>;
>>>> +};
>>>> +
>>> This will break bisection on those boards. Indeed, you added the OPPs on
>>> the first patch, and if you only apply that patch, the boards in the
>>> second patch will be missing their CPU regulator. The kernel will then
>>> ramp up the frequency to the highest OPP, but will not change the
>>> voltage, resulting in a crash.
>> This is a good point and I will merge those two patch.
> That's not what I meant to say. Those two patches are great separated.
> You can invert them though.
haha, invert them, so interesting. good idea.
>
>>> There's a similar issue for all the boards that don't have a regulator
>>> in the first place.
>>>
>>> The way we worked around this for the other SoCs is to have a DTSI with
>>> the OPPs with a frequency higher than what U-Boot boots with (1008MHz?),
>>> and only include that DTSI on boards that have a CPU regulator hooked in.
>> Is this really necessary? It seems like every board based on sun8i-r40
>> have a cpu regulator.
> This probably won't be the case whenever someone starts a new design,
> and then they'll face random crashes for no apparent reason, and waste a
> lot of time in the process.
>
> Whereas the alternative is that you would be missing some OPPs,
> something that is fairly easy to figure out.
How about remove the OPPs which greate that 1.08G in sun8i-r40.dtsi,
If some boards want to run at a higher frequency, can add them byself
in the board's file.
>
> Maxime


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

* Re: [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board
  2022-05-13  8:23         ` qianfan
@ 2022-05-16  7:53           ` Maxime Ripard
  2022-05-16 15:39             ` Chen-Yu Tsai
  0 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2022-05-16  7:53 UTC (permalink / raw)
  To: qianfan
  Cc: linux-sunxi, Rob Herring, Chen-Yu Tsai, Jernej Skrabec,
	Rafael J . Wysocki, Viresh Kumar, devicetree, linux-arm-kernel,
	linux-kernel, linux-pm

On Fri, May 13, 2022 at 04:23:20PM +0800, qianfan wrote:
> > > > There's a similar issue for all the boards that don't have a regulator
> > > > in the first place.
> > > > 
> > > > The way we worked around this for the other SoCs is to have a DTSI with
> > > > the OPPs with a frequency higher than what U-Boot boots with (1008MHz?),
> > > > and only include that DTSI on boards that have a CPU regulator hooked in.
> > > Is this really necessary? It seems like every board based on sun8i-r40
> > > have a cpu regulator.
> > This probably won't be the case whenever someone starts a new design,
> > and then they'll face random crashes for no apparent reason, and waste a
> > lot of time in the process.
> > 
> > Whereas the alternative is that you would be missing some OPPs,
> > something that is fairly easy to figure out.
>
> How about remove the OPPs which greate that 1.08G in sun8i-r40.dtsi,
> If some boards want to run at a higher frequency, can add them byself
> in the board's file.

You did all the work to support and test them already. It's a bit of a
waste to do that and not include it.

Just do a DTSI like we did for the A64 for example.

Maxime

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

* Re: [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board
  2022-05-16  7:53           ` Maxime Ripard
@ 2022-05-16 15:39             ` Chen-Yu Tsai
  0 siblings, 0 replies; 9+ messages in thread
From: Chen-Yu Tsai @ 2022-05-16 15:39 UTC (permalink / raw)
  To: qianfan
  Cc: linux-sunxi, Rob Herring, Jernej Skrabec, Rafael J . Wysocki,
	Viresh Kumar, devicetree, linux-arm-kernel, linux-kernel,
	open list:THERMAL, Maxime Ripard

On Mon, May 16, 2022 at 3:53 PM Maxime Ripard <maxime@cerno.tech> wrote:
>
> On Fri, May 13, 2022 at 04:23:20PM +0800, qianfan wrote:
> > > > > There's a similar issue for all the boards that don't have a regulator
> > > > > in the first place.
> > > > >
> > > > > The way we worked around this for the other SoCs is to have a DTSI with
> > > > > the OPPs with a frequency higher than what U-Boot boots with (1008MHz?),
> > > > > and only include that DTSI on boards that have a CPU regulator hooked in.
> > > > Is this really necessary? It seems like every board based on sun8i-r40
> > > > have a cpu regulator.
> > > This probably won't be the case whenever someone starts a new design,
> > > and then they'll face random crashes for no apparent reason, and waste a
> > > lot of time in the process.
> > >
> > > Whereas the alternative is that you would be missing some OPPs,
> > > something that is fairly easy to figure out.
> >
> > How about remove the OPPs which greate that 1.08G in sun8i-r40.dtsi,
> > If some boards want to run at a higher frequency, can add them byself
> > in the board's file.
>
> You did all the work to support and test them already. It's a bit of a
> waste to do that and not include it.
>
> Just do a DTSI like we did for the A64 for example.

There's also no guarantee that the board boots up at 1.08G. The board
may be set to boot up at a slightly lower frequency / voltage combination.
Or maybe the board's supply voltage simply isn't stable enough for sustained
high CPU usage at 1.08G.

Letting the kernel assume that it is OK to run at some OPP is not a good
idea. The boards should explicitly include the default OPP table, or define
their own, while adding a proper CPU supply at the same time.


Regards
ChenYu

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

end of thread, other threads:[~2022-05-16 15:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12  7:18 [PATCH v3 1/2] ARM: dts: sun8i-r40: add opp table for cpu qianfanguijin
2022-05-12  7:18 ` [PATCH v3 2/2] ARM: dts: sun8i-r40: Add "cpu-supply" node for sun8i-r40 based board qianfanguijin
2022-05-13  7:38   ` Maxime Ripard
2022-05-13  7:48     ` qianfan
2022-05-13  8:15       ` Maxime Ripard
2022-05-13  8:23         ` qianfan
2022-05-16  7:53           ` Maxime Ripard
2022-05-16 15:39             ` Chen-Yu Tsai
2022-05-12  7:29 ` [PATCH v3 1/2] ARM: dts: sun8i-r40: add opp table for cpu Viresh Kumar

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).