diff mbox series

[2/2] arm64: dts: mediatek: cherry: Add CPU supply dependency to cpufreq-hw

Message ID 20231229212853.277334-2-nfraprado@collabora.com (mailing list archive)
State New
Headers show
Series [1/2] dt-bindings: cpufreq: Add big CPU supply | expand

Commit Message

Nícolas F. R. A. Prado Dec. 29, 2023, 9:28 p.m. UTC
When the mediatek-cpufreq-hw driver enables the hardware (by
writing to REG_FREQ_ENABLE), if the regulator supplying the voltage to
the big CPUs hasn't probed yet, the platform hangs shortly after and
"rcu: INFO: rcu_preempt detected stalls on CPUs/tasks" are printed in
the log.

To prevent this from happening, describe the big CPUs regulator in the
performance-controller DT node, so that devlink ensures the regulator
has been probed and configured before the frequency scaling hardware is
probed and enabled.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

---

 arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Viresh Kumar Jan. 2, 2024, 6:11 a.m. UTC | #1
On 29-12-23, 18:28, Nícolas F. R. A. Prado wrote:
> When the mediatek-cpufreq-hw driver enables the hardware (by
> writing to REG_FREQ_ENABLE), if the regulator supplying the voltage to
> the big CPUs hasn't probed yet, the platform hangs shortly after and
> "rcu: INFO: rcu_preempt detected stalls on CPUs/tasks" are printed in
> the log.
> 
> To prevent this from happening, describe the big CPUs regulator in the
> performance-controller DT node, so that devlink ensures the regulator
> has been probed and configured before the frequency scaling hardware is
> probed and enabled.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> 
> ---
> 
>  arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> index dd5b89b73190..505da60eee90 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> @@ -502,6 +502,10 @@ &pcie1 {
>  	pinctrl-0 = <&pcie1_pins_default>;
>  };
>  
> +&performance {
> +	big-cpus-supply = <&mt6315_6_vbuck1>;
> +};
> +
>  &pio {
>  	mediatek,rsel-resistance-in-si-unit;
>  	pinctrl-names = "default";

I think the regulator needs to be mentioned in the CPU's node and not
here ?
AngeloGioacchino Del Regno Jan. 2, 2024, 9:09 a.m. UTC | #2
Il 02/01/24 07:11, Viresh Kumar ha scritto:
> On 29-12-23, 18:28, Nícolas F. R. A. Prado wrote:
>> When the mediatek-cpufreq-hw driver enables the hardware (by
>> writing to REG_FREQ_ENABLE), if the regulator supplying the voltage to
>> the big CPUs hasn't probed yet, the platform hangs shortly after and
>> "rcu: INFO: rcu_preempt detected stalls on CPUs/tasks" are printed in
>> the log.
>>
>> To prevent this from happening, describe the big CPUs regulator in the
>> performance-controller DT node, so that devlink ensures the regulator
>> has been probed and configured before the frequency scaling hardware is
>> probed and enabled.
>>
>> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
>>
>> ---
>>
>>   arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>> index dd5b89b73190..505da60eee90 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>> @@ -502,6 +502,10 @@ &pcie1 {
>>   	pinctrl-0 = <&pcie1_pins_default>;
>>   };
>>   
>> +&performance {
>> +	big-cpus-supply = <&mt6315_6_vbuck1>;
>> +};
>> +
>>   &pio {
>>   	mediatek,rsel-resistance-in-si-unit;
>>   	pinctrl-names = "default";
> 
> I think the regulator needs to be mentioned in the CPU's node and not
> here ?
> 

Even if the regulator voltage is being changed by firmware with cpufreq-hw, the
actual regulators should go to each CPU node and not in the cpufreq driver node,
I agree with Viresh.

Besides, that's the same thing that we're doing with mediatek-cpufreq as well...
and since we're talking about that, we should also do something about this such
that we stop declaring `regulator-always-on` for CPU cores in devicetree, but
this is probably slightly out of context for what you're trying to do here, so,
read that as an "extra consideration" :-)

Cheers,
Angelo
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index dd5b89b73190..505da60eee90 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -502,6 +502,10 @@  &pcie1 {
 	pinctrl-0 = <&pcie1_pins_default>;
 };
 
+&performance {
+	big-cpus-supply = <&mt6315_6_vbuck1>;
+};
+
 &pio {
 	mediatek,rsel-resistance-in-si-unit;
 	pinctrl-names = "default";