All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-15 12:03 ` Heiko Thiery
  0 siblings, 0 replies; 24+ messages in thread
From: Heiko Thiery @ 2021-09-15 12:03 UTC (permalink / raw)
  To: devicetree, linux-arm-kernel, linux-kernel
  Cc: Krzysztof Kozlowski, Michael Walle, Joakim Zhang, Shengjiu Wang,
	Rob Herring, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Heiko Thiery, Frieder Schrempf

The buck2 output of the PMIC is the VDD core voltage of the cpu.
Switching off this will poweroff the CPU. Add the 'regulator-always-on'
property to avoid this.

Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards")
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
 arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
index d0456daefda8..9db9b90bf2bc 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
@@ -102,6 +102,7 @@ reg_vdd_arm: BUCK2 {
 				regulator-min-microvolt = <850000>;
 				regulator-max-microvolt = <950000>;
 				regulator-boot-on;
+				regulator-always-on;
 				regulator-ramp-delay = <3125>;
 				nxp,dvs-run-voltage = <950000>;
 				nxp,dvs-standby-voltage = <850000>;
-- 
2.30.0


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

* [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-15 12:03 ` Heiko Thiery
  0 siblings, 0 replies; 24+ messages in thread
From: Heiko Thiery @ 2021-09-15 12:03 UTC (permalink / raw)
  To: devicetree, linux-arm-kernel, linux-kernel
  Cc: Krzysztof Kozlowski, Michael Walle, Joakim Zhang, Shengjiu Wang,
	Rob Herring, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Heiko Thiery, Frieder Schrempf

The buck2 output of the PMIC is the VDD core voltage of the cpu.
Switching off this will poweroff the CPU. Add the 'regulator-always-on'
property to avoid this.

Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards")
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
 arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
index d0456daefda8..9db9b90bf2bc 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
@@ -102,6 +102,7 @@ reg_vdd_arm: BUCK2 {
 				regulator-min-microvolt = <850000>;
 				regulator-max-microvolt = <950000>;
 				regulator-boot-on;
+				regulator-always-on;
 				regulator-ramp-delay = <3125>;
 				nxp,dvs-run-voltage = <950000>;
 				nxp,dvs-standby-voltage = <850000>;
-- 
2.30.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-15 12:03 ` Heiko Thiery
@ 2021-09-15 12:05   ` Michael Walle
  -1 siblings, 0 replies; 24+ messages in thread
From: Michael Walle @ 2021-09-15 12:05 UTC (permalink / raw)
  To: Heiko Thiery
  Cc: devicetree, linux-arm-kernel, linux-kernel, Krzysztof Kozlowski,
	Joakim Zhang, Shengjiu Wang, Rob Herring, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Frieder Schrempf

Am 2021-09-15 14:03, schrieb Heiko Thiery:
> The buck2 output of the PMIC is the VDD core voltage of the cpu.
> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> property to avoid this.

Mh, have this ever worked? Is there a commit which introduced a 
regression?

-michael

> Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and
> baseboards")
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-15 12:05   ` Michael Walle
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Walle @ 2021-09-15 12:05 UTC (permalink / raw)
  To: Heiko Thiery
  Cc: devicetree, linux-arm-kernel, linux-kernel, Krzysztof Kozlowski,
	Joakim Zhang, Shengjiu Wang, Rob Herring, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Frieder Schrempf

Am 2021-09-15 14:03, schrieb Heiko Thiery:
> The buck2 output of the PMIC is the VDD core voltage of the cpu.
> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> property to avoid this.

Mh, have this ever worked? Is there a commit which introduced a 
regression?

-michael

> Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and
> baseboards")
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-15 12:05   ` Michael Walle
@ 2021-09-15 12:09     ` Frieder Schrempf
  -1 siblings, 0 replies; 24+ messages in thread
From: Frieder Schrempf @ 2021-09-15 12:09 UTC (permalink / raw)
  To: Michael Walle, Heiko Thiery
  Cc: devicetree, linux-arm-kernel, linux-kernel, Krzysztof Kozlowski,
	Joakim Zhang, Shengjiu Wang, Rob Herring, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team

On 15.09.21 14:05, Michael Walle wrote:
> Am 2021-09-15 14:03, schrieb Heiko Thiery:
>> The buck2 output of the PMIC is the VDD core voltage of the cpu.
>> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
>> property to avoid this.
> 
> Mh, have this ever worked? Is there a commit which introduced a regression?

Yes, this did work before, even without 'regulator-always-on'. I
currently don't understand why this is needed. The regulator is
referenced in the CPU nodes as 'cpu-supply'. This should be enough to
not disable it as long as the CPU is up.

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-15 12:09     ` Frieder Schrempf
  0 siblings, 0 replies; 24+ messages in thread
From: Frieder Schrempf @ 2021-09-15 12:09 UTC (permalink / raw)
  To: Michael Walle, Heiko Thiery
  Cc: devicetree, linux-arm-kernel, linux-kernel, Krzysztof Kozlowski,
	Joakim Zhang, Shengjiu Wang, Rob Herring, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team

On 15.09.21 14:05, Michael Walle wrote:
> Am 2021-09-15 14:03, schrieb Heiko Thiery:
>> The buck2 output of the PMIC is the VDD core voltage of the cpu.
>> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
>> property to avoid this.
> 
> Mh, have this ever worked? Is there a commit which introduced a regression?

Yes, this did work before, even without 'regulator-always-on'. I
currently don't understand why this is needed. The regulator is
referenced in the CPU nodes as 'cpu-supply'. This should be enough to
not disable it as long as the CPU is up.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-15 12:09     ` Frieder Schrempf
@ 2021-09-17  7:28       ` Heiko Thiery
  -1 siblings, 0 replies; 24+ messages in thread
From: Heiko Thiery @ 2021-09-17  7:28 UTC (permalink / raw)
  To: Frieder Schrempf
  Cc: Michael Walle, devicetree, linux-arm-kernel, linux-kernel,
	Krzysztof Kozlowski, Joakim Zhang, Shengjiu Wang, Rob Herring,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Guido Günther, Angus Ainslie (Purism)

Hi Frieder,

Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
<frieder.schrempf@kontron.de>:
>
> On 15.09.21 14:05, Michael Walle wrote:
> > Am 2021-09-15 14:03, schrieb Heiko Thiery:
> >> The buck2 output of the PMIC is the VDD core voltage of the cpu.
> >> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> >> property to avoid this.
> >
> > Mh, have this ever worked? Is there a commit which introduced a regression?
>
> Yes, this did work before, even without 'regulator-always-on'. I
> currently don't understand why this is needed. The regulator is
> referenced in the CPU nodes as 'cpu-supply'. This should be enough to
> not disable it as long as the CPU is up.

I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
same issue:

[ 31.716031] vdd-5v: disabling
[ 31.719032] rst-usb-eth2: disabling
[ 31.722553] buck2: disabling

While on that I tried to compare with other boards and see that they
also have the cpu-voltage marked as "regulator-always-on". The only
exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
has not set this property.

I agree with you and don't understand why this is happening. Has
anyone else an explanation?

[1] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts#L319

-- 
Heiko

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-17  7:28       ` Heiko Thiery
  0 siblings, 0 replies; 24+ messages in thread
From: Heiko Thiery @ 2021-09-17  7:28 UTC (permalink / raw)
  To: Frieder Schrempf
  Cc: Michael Walle, devicetree, linux-arm-kernel, linux-kernel,
	Krzysztof Kozlowski, Joakim Zhang, Shengjiu Wang, Rob Herring,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Guido Günther, Angus Ainslie (Purism)

Hi Frieder,

Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
<frieder.schrempf@kontron.de>:
>
> On 15.09.21 14:05, Michael Walle wrote:
> > Am 2021-09-15 14:03, schrieb Heiko Thiery:
> >> The buck2 output of the PMIC is the VDD core voltage of the cpu.
> >> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> >> property to avoid this.
> >
> > Mh, have this ever worked? Is there a commit which introduced a regression?
>
> Yes, this did work before, even without 'regulator-always-on'. I
> currently don't understand why this is needed. The regulator is
> referenced in the CPU nodes as 'cpu-supply'. This should be enough to
> not disable it as long as the CPU is up.

I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
same issue:

[ 31.716031] vdd-5v: disabling
[ 31.719032] rst-usb-eth2: disabling
[ 31.722553] buck2: disabling

While on that I tried to compare with other boards and see that they
also have the cpu-voltage marked as "regulator-always-on". The only
exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
has not set this property.

I agree with you and don't understand why this is happening. Has
anyone else an explanation?

[1] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts#L319

-- 
Heiko

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-17  7:28       ` Heiko Thiery
@ 2021-09-17  8:21         ` Michael Walle
  -1 siblings, 0 replies; 24+ messages in thread
From: Michael Walle @ 2021-09-17  8:21 UTC (permalink / raw)
  To: Heiko Thiery, Frieder Schrempf
  Cc: devicetree, linux-arm-kernel, linux-kernel, Krzysztof Kozlowski,
	Joakim Zhang, Shengjiu Wang, Rob Herring, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Guido Günther, Angus Ainslie (Purism)

Am 17. September 2021 09:28:51 MESZ schrieb Heiko Thiery <heiko.thiery@gmail.com>:
>Hi Frieder,
>
>Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
><frieder.schrempf@kontron.de>:
>>
>> On 15.09.21 14:05, Michael Walle wrote:
>> > Am 2021-09-15 14:03, schrieb Heiko Thiery:
>> >> The buck2 output of the PMIC is the VDD core voltage of the cpu.
>> >> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
>> >> property to avoid this.
>> >
>> > Mh, have this ever worked? Is there a commit which introduced a regression?
>>
>> Yes, this did work before, even without 'regulator-always-on'. I
>> currently don't understand why this is needed. The regulator is
>> referenced in the CPU nodes as 'cpu-supply'. This should be enough to
>> not disable it as long as the CPU is up.
>
>I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
>same issue:
>
>[ 31.716031] vdd-5v: disabling
>[ 31.719032] rst-usb-eth2: disabling
>[ 31.722553] buck2: disabling
>
>While on that I tried to compare with other boards and see that they
>also have the cpu-voltage marked as "regulator-always-on". The only
>exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
>has not set this property.
>
>I agree with you and don't understand why this is happening. Has
>anyone else an explanation?

Do you have the CPU frequency scaling driver enabled? 

-michael


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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-17  8:21         ` Michael Walle
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Walle @ 2021-09-17  8:21 UTC (permalink / raw)
  To: Heiko Thiery, Frieder Schrempf
  Cc: devicetree, linux-arm-kernel, linux-kernel, Krzysztof Kozlowski,
	Joakim Zhang, Shengjiu Wang, Rob Herring, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Guido Günther, Angus Ainslie (Purism)

Am 17. September 2021 09:28:51 MESZ schrieb Heiko Thiery <heiko.thiery@gmail.com>:
>Hi Frieder,
>
>Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
><frieder.schrempf@kontron.de>:
>>
>> On 15.09.21 14:05, Michael Walle wrote:
>> > Am 2021-09-15 14:03, schrieb Heiko Thiery:
>> >> The buck2 output of the PMIC is the VDD core voltage of the cpu.
>> >> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
>> >> property to avoid this.
>> >
>> > Mh, have this ever worked? Is there a commit which introduced a regression?
>>
>> Yes, this did work before, even without 'regulator-always-on'. I
>> currently don't understand why this is needed. The regulator is
>> referenced in the CPU nodes as 'cpu-supply'. This should be enough to
>> not disable it as long as the CPU is up.
>
>I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
>same issue:
>
>[ 31.716031] vdd-5v: disabling
>[ 31.719032] rst-usb-eth2: disabling
>[ 31.722553] buck2: disabling
>
>While on that I tried to compare with other boards and see that they
>also have the cpu-voltage marked as "regulator-always-on". The only
>exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
>has not set this property.
>
>I agree with you and don't understand why this is happening. Has
>anyone else an explanation?

Do you have the CPU frequency scaling driver enabled? 

-michael


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-17  8:21         ` Michael Walle
@ 2021-09-17  8:51           ` Heiko Thiery
  -1 siblings, 0 replies; 24+ messages in thread
From: Heiko Thiery @ 2021-09-17  8:51 UTC (permalink / raw)
  To: Michael Walle
  Cc: Frieder Schrempf, devicetree, linux-arm-kernel, linux-kernel,
	Krzysztof Kozlowski, Joakim Zhang, Shengjiu Wang, Rob Herring,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Guido Günther, Angus Ainslie (Purism)

HI Michael,

Am Fr., 17. Sept. 2021 um 10:21 Uhr schrieb Michael Walle <michael@walle.cc>:
>
> Am 17. September 2021 09:28:51 MESZ schrieb Heiko Thiery <heiko.thiery@gmail.com>:
> >Hi Frieder,
> >
> >Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
> ><frieder.schrempf@kontron.de>:
> >>
> >> On 15.09.21 14:05, Michael Walle wrote:
> >> > Am 2021-09-15 14:03, schrieb Heiko Thiery:
> >> >> The buck2 output of the PMIC is the VDD core voltage of the cpu.
> >> >> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> >> >> property to avoid this.
> >> >
> >> > Mh, have this ever worked? Is there a commit which introduced a regression?
> >>
> >> Yes, this did work before, even without 'regulator-always-on'. I
> >> currently don't understand why this is needed. The regulator is
> >> referenced in the CPU nodes as 'cpu-supply'. This should be enough to
> >> not disable it as long as the CPU is up.
> >
> >I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
> >same issue:
> >
> >[ 31.716031] vdd-5v: disabling
> >[ 31.719032] rst-usb-eth2: disabling
> >[ 31.722553] buck2: disabling
> >
> >While on that I tried to compare with other boards and see that they
> >also have the cpu-voltage marked as "regulator-always-on". The only
> >exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
> >has not set this property.
> >
> >I agree with you and don't understand why this is happening. Has
> >anyone else an explanation?
>
> Do you have the CPU frequency scaling driver enabled?

That was a good hint. What I now see is in my case the driver is not
loaded (I boot via network). In the default kernel config the module
is marked as 'm'. When switching to 'y' as expected it will be probed
and the the buck2 (cpu-supply) will not be deactivated after 30
seconds.

-- 
Heiko

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-17  8:51           ` Heiko Thiery
  0 siblings, 0 replies; 24+ messages in thread
From: Heiko Thiery @ 2021-09-17  8:51 UTC (permalink / raw)
  To: Michael Walle
  Cc: Frieder Schrempf, devicetree, linux-arm-kernel, linux-kernel,
	Krzysztof Kozlowski, Joakim Zhang, Shengjiu Wang, Rob Herring,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Guido Günther, Angus Ainslie (Purism)

HI Michael,

Am Fr., 17. Sept. 2021 um 10:21 Uhr schrieb Michael Walle <michael@walle.cc>:
>
> Am 17. September 2021 09:28:51 MESZ schrieb Heiko Thiery <heiko.thiery@gmail.com>:
> >Hi Frieder,
> >
> >Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
> ><frieder.schrempf@kontron.de>:
> >>
> >> On 15.09.21 14:05, Michael Walle wrote:
> >> > Am 2021-09-15 14:03, schrieb Heiko Thiery:
> >> >> The buck2 output of the PMIC is the VDD core voltage of the cpu.
> >> >> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> >> >> property to avoid this.
> >> >
> >> > Mh, have this ever worked? Is there a commit which introduced a regression?
> >>
> >> Yes, this did work before, even without 'regulator-always-on'. I
> >> currently don't understand why this is needed. The regulator is
> >> referenced in the CPU nodes as 'cpu-supply'. This should be enough to
> >> not disable it as long as the CPU is up.
> >
> >I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
> >same issue:
> >
> >[ 31.716031] vdd-5v: disabling
> >[ 31.719032] rst-usb-eth2: disabling
> >[ 31.722553] buck2: disabling
> >
> >While on that I tried to compare with other boards and see that they
> >also have the cpu-voltage marked as "regulator-always-on". The only
> >exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
> >has not set this property.
> >
> >I agree with you and don't understand why this is happening. Has
> >anyone else an explanation?
>
> Do you have the CPU frequency scaling driver enabled?

That was a good hint. What I now see is in my case the driver is not
loaded (I boot via network). In the default kernel config the module
is marked as 'm'. When switching to 'y' as expected it will be probed
and the the buck2 (cpu-supply) will not be deactivated after 30
seconds.

-- 
Heiko

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-17  7:28       ` Heiko Thiery
@ 2021-09-17 11:44         ` Lucas Stach
  -1 siblings, 0 replies; 24+ messages in thread
From: Lucas Stach @ 2021-09-17 11:44 UTC (permalink / raw)
  To: Heiko Thiery, Frieder Schrempf
  Cc: devicetree, Guido Günther, Fabio Estevam, Shengjiu Wang,
	Angus Ainslie (Purism),
	linux-kernel, Krzysztof Kozlowski, Joakim Zhang, Michael Walle,
	Rob Herring, NXP Linux Team, Pengutronix Kernel Team, Shawn Guo,
	Sascha Hauer, linux-arm-kernel

Am Freitag, dem 17.09.2021 um 09:28 +0200 schrieb Heiko Thiery:
> Hi Frieder,
> 
> Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
> <frieder.schrempf@kontron.de>:
> > 
> > On 15.09.21 14:05, Michael Walle wrote:
> > > Am 2021-09-15 14:03, schrieb Heiko Thiery:
> > > > The buck2 output of the PMIC is the VDD core voltage of the cpu.
> > > > Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> > > > property to avoid this.
> > > 
> > > Mh, have this ever worked? Is there a commit which introduced a regression?
> > 
> > Yes, this did work before, even without 'regulator-always-on'. I
> > currently don't understand why this is needed. The regulator is
> > referenced in the CPU nodes as 'cpu-supply'. This should be enough to
> > not disable it as long as the CPU is up.
> 
> I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
> same issue:
> 
> [ 31.716031] vdd-5v: disabling
> [ 31.719032] rst-usb-eth2: disabling
> [ 31.722553] buck2: disabling
> 
> While on that I tried to compare with other boards and see that they
> also have the cpu-voltage marked as "regulator-always-on". The only
> exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
> has not set this property.
> 
> I agree with you and don't understand why this is happening. Has
> anyone else an explanation?
> 
> [1] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts#L319
> 
Maybe your kernel config is missing the cpufreq driver, so you don't
have a consumer of the regulator?

Marking the regulator as always-on seems like the right thing to do,
you don't want to depend on a consumer showing up to make sure that
your CPU voltage isn't cut...

Regards,
Lucas


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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-17 11:44         ` Lucas Stach
  0 siblings, 0 replies; 24+ messages in thread
From: Lucas Stach @ 2021-09-17 11:44 UTC (permalink / raw)
  To: Heiko Thiery, Frieder Schrempf
  Cc: devicetree, Guido Günther, Fabio Estevam, Shengjiu Wang,
	Angus Ainslie (Purism),
	linux-kernel, Krzysztof Kozlowski, Joakim Zhang, Michael Walle,
	Rob Herring, NXP Linux Team, Pengutronix Kernel Team, Shawn Guo,
	Sascha Hauer, linux-arm-kernel

Am Freitag, dem 17.09.2021 um 09:28 +0200 schrieb Heiko Thiery:
> Hi Frieder,
> 
> Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
> <frieder.schrempf@kontron.de>:
> > 
> > On 15.09.21 14:05, Michael Walle wrote:
> > > Am 2021-09-15 14:03, schrieb Heiko Thiery:
> > > > The buck2 output of the PMIC is the VDD core voltage of the cpu.
> > > > Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> > > > property to avoid this.
> > > 
> > > Mh, have this ever worked? Is there a commit which introduced a regression?
> > 
> > Yes, this did work before, even without 'regulator-always-on'. I
> > currently don't understand why this is needed. The regulator is
> > referenced in the CPU nodes as 'cpu-supply'. This should be enough to
> > not disable it as long as the CPU is up.
> 
> I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
> same issue:
> 
> [ 31.716031] vdd-5v: disabling
> [ 31.719032] rst-usb-eth2: disabling
> [ 31.722553] buck2: disabling
> 
> While on that I tried to compare with other boards and see that they
> also have the cpu-voltage marked as "regulator-always-on". The only
> exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
> has not set this property.
> 
> I agree with you and don't understand why this is happening. Has
> anyone else an explanation?
> 
> [1] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts#L319
> 
Maybe your kernel config is missing the cpufreq driver, so you don't
have a consumer of the regulator?

Marking the regulator as always-on seems like the right thing to do,
you don't want to depend on a consumer showing up to make sure that
your CPU voltage isn't cut...

Regards,
Lucas


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-17 11:44         ` Lucas Stach
@ 2021-09-17 16:10           ` Heiko Thiery
  -1 siblings, 0 replies; 24+ messages in thread
From: Heiko Thiery @ 2021-09-17 16:10 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Frieder Schrempf, devicetree, Guido Günther, Fabio Estevam,
	Shengjiu Wang, Angus Ainslie (Purism),
	linux-kernel, Krzysztof Kozlowski, Joakim Zhang, Michael Walle,
	Rob Herring, NXP Linux Team, Pengutronix Kernel Team, Shawn Guo,
	Sascha Hauer, linux-arm-kernel

Hi Lucas,

Am Fr., 17. Sept. 2021 um 13:44 Uhr schrieb Lucas Stach
<l.stach@pengutronix.de>:
>
> Am Freitag, dem 17.09.2021 um 09:28 +0200 schrieb Heiko Thiery:
> > Hi Frieder,
> >
> > Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
> > <frieder.schrempf@kontron.de>:
> > >
> > > On 15.09.21 14:05, Michael Walle wrote:
> > > > Am 2021-09-15 14:03, schrieb Heiko Thiery:
> > > > > The buck2 output of the PMIC is the VDD core voltage of the cpu.
> > > > > Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> > > > > property to avoid this.
> > > >
> > > > Mh, have this ever worked? Is there a commit which introduced a regression?
> > >
> > > Yes, this did work before, even without 'regulator-always-on'. I
> > > currently don't understand why this is needed. The regulator is
> > > referenced in the CPU nodes as 'cpu-supply'. This should be enough to
> > > not disable it as long as the CPU is up.
> >
> > I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
> > same issue:
> >
> > [ 31.716031] vdd-5v: disabling
> > [ 31.719032] rst-usb-eth2: disabling
> > [ 31.722553] buck2: disabling
> >
> > While on that I tried to compare with other boards and see that they
> > also have the cpu-voltage marked as "regulator-always-on". The only
> > exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
> > has not set this property.
> >
> > I agree with you and don't understand why this is happening. Has
> > anyone else an explanation?
> >
> > [1] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts#L319
> >
> Maybe your kernel config is missing the cpufreq driver, so you don't
> have a consumer of the regulator?
>
> Marking the regulator as always-on seems like the right thing to do,
> you don't want to depend on a consumer showing up to make sure that
> your CPU voltage isn't cut...

shouldn't it be that the node cpu-supply here is a consumer of the
referenced voltage?

-- 
Heiko

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-17 16:10           ` Heiko Thiery
  0 siblings, 0 replies; 24+ messages in thread
From: Heiko Thiery @ 2021-09-17 16:10 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Frieder Schrempf, devicetree, Guido Günther, Fabio Estevam,
	Shengjiu Wang, Angus Ainslie (Purism),
	linux-kernel, Krzysztof Kozlowski, Joakim Zhang, Michael Walle,
	Rob Herring, NXP Linux Team, Pengutronix Kernel Team, Shawn Guo,
	Sascha Hauer, linux-arm-kernel

Hi Lucas,

Am Fr., 17. Sept. 2021 um 13:44 Uhr schrieb Lucas Stach
<l.stach@pengutronix.de>:
>
> Am Freitag, dem 17.09.2021 um 09:28 +0200 schrieb Heiko Thiery:
> > Hi Frieder,
> >
> > Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
> > <frieder.schrempf@kontron.de>:
> > >
> > > On 15.09.21 14:05, Michael Walle wrote:
> > > > Am 2021-09-15 14:03, schrieb Heiko Thiery:
> > > > > The buck2 output of the PMIC is the VDD core voltage of the cpu.
> > > > > Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> > > > > property to avoid this.
> > > >
> > > > Mh, have this ever worked? Is there a commit which introduced a regression?
> > >
> > > Yes, this did work before, even without 'regulator-always-on'. I
> > > currently don't understand why this is needed. The regulator is
> > > referenced in the CPU nodes as 'cpu-supply'. This should be enough to
> > > not disable it as long as the CPU is up.
> >
> > I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
> > same issue:
> >
> > [ 31.716031] vdd-5v: disabling
> > [ 31.719032] rst-usb-eth2: disabling
> > [ 31.722553] buck2: disabling
> >
> > While on that I tried to compare with other boards and see that they
> > also have the cpu-voltage marked as "regulator-always-on". The only
> > exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
> > has not set this property.
> >
> > I agree with you and don't understand why this is happening. Has
> > anyone else an explanation?
> >
> > [1] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts#L319
> >
> Maybe your kernel config is missing the cpufreq driver, so you don't
> have a consumer of the regulator?
>
> Marking the regulator as always-on seems like the right thing to do,
> you don't want to depend on a consumer showing up to make sure that
> your CPU voltage isn't cut...

shouldn't it be that the node cpu-supply here is a consumer of the
referenced voltage?

-- 
Heiko

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-17 16:10           ` Heiko Thiery
@ 2021-09-20  7:31             ` Frieder Schrempf
  -1 siblings, 0 replies; 24+ messages in thread
From: Frieder Schrempf @ 2021-09-20  7:31 UTC (permalink / raw)
  To: Heiko Thiery, Lucas Stach
  Cc: devicetree, Guido Günther, Fabio Estevam, Shengjiu Wang,
	Angus Ainslie (Purism),
	linux-kernel, Krzysztof Kozlowski, Joakim Zhang, Michael Walle,
	Rob Herring, NXP Linux Team, Pengutronix Kernel Team, Shawn Guo,
	Sascha Hauer, linux-arm-kernel

On 17.09.21 18:10, Heiko Thiery wrote:
> Hi Lucas,
> 
> Am Fr., 17. Sept. 2021 um 13:44 Uhr schrieb Lucas Stach
> <l.stach@pengutronix.de>:
>>
>> Am Freitag, dem 17.09.2021 um 09:28 +0200 schrieb Heiko Thiery:
>>> Hi Frieder,
>>>
>>> Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
>>> <frieder.schrempf@kontron.de>:
>>>>
>>>> On 15.09.21 14:05, Michael Walle wrote:
>>>>> Am 2021-09-15 14:03, schrieb Heiko Thiery:
>>>>>> The buck2 output of the PMIC is the VDD core voltage of the cpu.
>>>>>> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
>>>>>> property to avoid this.
>>>>>
>>>>> Mh, have this ever worked? Is there a commit which introduced a regression?
>>>>
>>>> Yes, this did work before, even without 'regulator-always-on'. I
>>>> currently don't understand why this is needed. The regulator is
>>>> referenced in the CPU nodes as 'cpu-supply'. This should be enough to
>>>> not disable it as long as the CPU is up.
>>>
>>> I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
>>> same issue:
>>>
>>> [ 31.716031] vdd-5v: disabling
>>> [ 31.719032] rst-usb-eth2: disabling
>>> [ 31.722553] buck2: disabling
>>>
>>> While on that I tried to compare with other boards and see that they
>>> also have the cpu-voltage marked as "regulator-always-on". The only
>>> exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
>>> has not set this property.
>>>
>>> I agree with you and don't understand why this is happening. Has
>>> anyone else an explanation?
>>>
>>> [1] https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Flatest%2Fsource%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx8mq-librem5-devkit.dts%23L319&amp;data=04%7C01%7Cfrieder.schrempf%40kontron.de%7Cce9d266ad78a4d06721008d979f5aeed%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637674918380815550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PsTKX4MXGwvvP6WxmQ1OWc8e32YI6Nsu%2FEkcNR4V8is%3D&amp;reserved=0
>>>
>> Maybe your kernel config is missing the cpufreq driver, so you don't
>> have a consumer of the regulator?
>>
>> Marking the regulator as always-on seems like the right thing to do,
>> you don't want to depend on a consumer showing up to make sure that
>> your CPU voltage isn't cut...
> 
> shouldn't it be that the node cpu-supply here is a consumer of the
> referenced voltage?

Yes, but as Michael and Lucas noted, the consumer is only active if the
cpufreq driver is loaded and we don't want to depend on this. In my
config I always had this compiled into the kernel so I didn't notice
that the always-on property is missing.

I'm not sure if shutting down the regulator is allowed to save power in
suspend, but that's something we could tackle later, for now:

Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>

Thanks Heiko for investigating and Michael and Lucas for helping!

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-20  7:31             ` Frieder Schrempf
  0 siblings, 0 replies; 24+ messages in thread
From: Frieder Schrempf @ 2021-09-20  7:31 UTC (permalink / raw)
  To: Heiko Thiery, Lucas Stach
  Cc: devicetree, Guido Günther, Fabio Estevam, Shengjiu Wang,
	Angus Ainslie (Purism),
	linux-kernel, Krzysztof Kozlowski, Joakim Zhang, Michael Walle,
	Rob Herring, NXP Linux Team, Pengutronix Kernel Team, Shawn Guo,
	Sascha Hauer, linux-arm-kernel

On 17.09.21 18:10, Heiko Thiery wrote:
> Hi Lucas,
> 
> Am Fr., 17. Sept. 2021 um 13:44 Uhr schrieb Lucas Stach
> <l.stach@pengutronix.de>:
>>
>> Am Freitag, dem 17.09.2021 um 09:28 +0200 schrieb Heiko Thiery:
>>> Hi Frieder,
>>>
>>> Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
>>> <frieder.schrempf@kontron.de>:
>>>>
>>>> On 15.09.21 14:05, Michael Walle wrote:
>>>>> Am 2021-09-15 14:03, schrieb Heiko Thiery:
>>>>>> The buck2 output of the PMIC is the VDD core voltage of the cpu.
>>>>>> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
>>>>>> property to avoid this.
>>>>>
>>>>> Mh, have this ever worked? Is there a commit which introduced a regression?
>>>>
>>>> Yes, this did work before, even without 'regulator-always-on'. I
>>>> currently don't understand why this is needed. The regulator is
>>>> referenced in the CPU nodes as 'cpu-supply'. This should be enough to
>>>> not disable it as long as the CPU is up.
>>>
>>> I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
>>> same issue:
>>>
>>> [ 31.716031] vdd-5v: disabling
>>> [ 31.719032] rst-usb-eth2: disabling
>>> [ 31.722553] buck2: disabling
>>>
>>> While on that I tried to compare with other boards and see that they
>>> also have the cpu-voltage marked as "regulator-always-on". The only
>>> exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
>>> has not set this property.
>>>
>>> I agree with you and don't understand why this is happening. Has
>>> anyone else an explanation?
>>>
>>> [1] https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Flatest%2Fsource%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx8mq-librem5-devkit.dts%23L319&amp;data=04%7C01%7Cfrieder.schrempf%40kontron.de%7Cce9d266ad78a4d06721008d979f5aeed%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637674918380815550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PsTKX4MXGwvvP6WxmQ1OWc8e32YI6Nsu%2FEkcNR4V8is%3D&amp;reserved=0
>>>
>> Maybe your kernel config is missing the cpufreq driver, so you don't
>> have a consumer of the regulator?
>>
>> Marking the regulator as always-on seems like the right thing to do,
>> you don't want to depend on a consumer showing up to make sure that
>> your CPU voltage isn't cut...
> 
> shouldn't it be that the node cpu-supply here is a consumer of the
> referenced voltage?

Yes, but as Michael and Lucas noted, the consumer is only active if the
cpufreq driver is loaded and we don't want to depend on this. In my
config I always had this compiled into the kernel so I didn't notice
that the always-on property is missing.

I'm not sure if shutting down the regulator is allowed to save power in
suspend, but that's something we could tackle later, for now:

Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>

Thanks Heiko for investigating and Michael and Lucas for helping!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-20  7:31             ` Frieder Schrempf
@ 2021-09-20  7:43               ` Michael Walle
  -1 siblings, 0 replies; 24+ messages in thread
From: Michael Walle @ 2021-09-20  7:43 UTC (permalink / raw)
  To: Frieder Schrempf, Heiko Thiery, Lucas Stach
  Cc: devicetree, Guido Günther, Fabio Estevam, Shengjiu Wang,
	Angus Ainslie (Purism),
	linux-kernel, Krzysztof Kozlowski, Joakim Zhang, Rob Herring,
	NXP Linux Team, Pengutronix Kernel Team, Shawn Guo, Sascha Hauer,
	linux-arm-kernel

Am 20. September 2021 09:31:20 MESZ schrieb Frieder Schrempf <frieder.schrempf@kontron.de>:
>On 17.09.21 18:10, Heiko Thiery wrote:
>> Hi Lucas,
>> 
>> Am Fr., 17. Sept. 2021 um 13:44 Uhr schrieb Lucas Stach
>> <l.stach@pengutronix.de>:
>>>
>>> Am Freitag, dem 17.09.2021 um 09:28 +0200 schrieb Heiko Thiery:
>>>> Hi Frieder,
>>>>
>>>> Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
>>>> <frieder.schrempf@kontron.de>:
>>>>>
>>>>> On 15.09.21 14:05, Michael Walle wrote:
>>>>>> Am 2021-09-15 14:03, schrieb Heiko Thiery:
>>>>>>> The buck2 output of the PMIC is the VDD core voltage of the cpu.
>>>>>>> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
>>>>>>> property to avoid this.
>>>>>>
>>>>>> Mh, have this ever worked? Is there a commit which introduced a regression?
>>>>>
>>>>> Yes, this did work before, even without 'regulator-always-on'. I
>>>>> currently don't understand why this is needed. The regulator is
>>>>> referenced in the CPU nodes as 'cpu-supply'. This should be enough to
>>>>> not disable it as long as the CPU is up.
>>>>
>>>> I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
>>>> same issue:
>>>>
>>>> [ 31.716031] vdd-5v: disabling
>>>> [ 31.719032] rst-usb-eth2: disabling
>>>> [ 31.722553] buck2: disabling
>>>>
>>>> While on that I tried to compare with other boards and see that they
>>>> also have the cpu-voltage marked as "regulator-always-on". The only
>>>> exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
>>>> has not set this property.
>>>>
>>>> I agree with you and don't understand why this is happening. Has
>>>> anyone else an explanation?
>>>>
>>>> [1] https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Flatest%2Fsource%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx8mq-librem5-devkit.dts%23L319&amp;data=04%7C01%7Cfrieder.schrempf%40kontron.de%7Cce9d266ad78a4d06721008d979f5aeed%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637674918380815550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PsTKX4MXGwvvP6WxmQ1OWc8e32YI6Nsu%2FEkcNR4V8is%3D&amp;reserved=0
>>>>
>>> Maybe your kernel config is missing the cpufreq driver, so you don't
>>> have a consumer of the regulator?
>>>
>>> Marking the regulator as always-on seems like the right thing to do,
>>> you don't want to depend on a consumer showing up to make sure that
>>> your CPU voltage isn't cut...
>> 
>> shouldn't it be that the node cpu-supply here is a consumer of the
>> referenced voltage?
>
>Yes, but as Michael and Lucas noted, the consumer is only active if the
>cpufreq driver is loaded and we don't want to depend on this. In my
>config I always had this compiled into the kernel so I didn't notice
>that the always-on property is missing.

Hm. So any cpu core voltage has to have the "always-on" property? On any SoC? Shouldn't there be some code to prevent the disabling of the voltage if the cpu nodes have a cpu-supply phandle?

-michael


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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-20  7:43               ` Michael Walle
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Walle @ 2021-09-20  7:43 UTC (permalink / raw)
  To: Frieder Schrempf, Heiko Thiery, Lucas Stach
  Cc: devicetree, Guido Günther, Fabio Estevam, Shengjiu Wang,
	Angus Ainslie (Purism),
	linux-kernel, Krzysztof Kozlowski, Joakim Zhang, Rob Herring,
	NXP Linux Team, Pengutronix Kernel Team, Shawn Guo, Sascha Hauer,
	linux-arm-kernel

Am 20. September 2021 09:31:20 MESZ schrieb Frieder Schrempf <frieder.schrempf@kontron.de>:
>On 17.09.21 18:10, Heiko Thiery wrote:
>> Hi Lucas,
>> 
>> Am Fr., 17. Sept. 2021 um 13:44 Uhr schrieb Lucas Stach
>> <l.stach@pengutronix.de>:
>>>
>>> Am Freitag, dem 17.09.2021 um 09:28 +0200 schrieb Heiko Thiery:
>>>> Hi Frieder,
>>>>
>>>> Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
>>>> <frieder.schrempf@kontron.de>:
>>>>>
>>>>> On 15.09.21 14:05, Michael Walle wrote:
>>>>>> Am 2021-09-15 14:03, schrieb Heiko Thiery:
>>>>>>> The buck2 output of the PMIC is the VDD core voltage of the cpu.
>>>>>>> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
>>>>>>> property to avoid this.
>>>>>>
>>>>>> Mh, have this ever worked? Is there a commit which introduced a regression?
>>>>>
>>>>> Yes, this did work before, even without 'regulator-always-on'. I
>>>>> currently don't understand why this is needed. The regulator is
>>>>> referenced in the CPU nodes as 'cpu-supply'. This should be enough to
>>>>> not disable it as long as the CPU is up.
>>>>
>>>> I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
>>>> same issue:
>>>>
>>>> [ 31.716031] vdd-5v: disabling
>>>> [ 31.719032] rst-usb-eth2: disabling
>>>> [ 31.722553] buck2: disabling
>>>>
>>>> While on that I tried to compare with other boards and see that they
>>>> also have the cpu-voltage marked as "regulator-always-on". The only
>>>> exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
>>>> has not set this property.
>>>>
>>>> I agree with you and don't understand why this is happening. Has
>>>> anyone else an explanation?
>>>>
>>>> [1] https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Flatest%2Fsource%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx8mq-librem5-devkit.dts%23L319&amp;data=04%7C01%7Cfrieder.schrempf%40kontron.de%7Cce9d266ad78a4d06721008d979f5aeed%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637674918380815550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PsTKX4MXGwvvP6WxmQ1OWc8e32YI6Nsu%2FEkcNR4V8is%3D&amp;reserved=0
>>>>
>>> Maybe your kernel config is missing the cpufreq driver, so you don't
>>> have a consumer of the regulator?
>>>
>>> Marking the regulator as always-on seems like the right thing to do,
>>> you don't want to depend on a consumer showing up to make sure that
>>> your CPU voltage isn't cut...
>> 
>> shouldn't it be that the node cpu-supply here is a consumer of the
>> referenced voltage?
>
>Yes, but as Michael and Lucas noted, the consumer is only active if the
>cpufreq driver is loaded and we don't want to depend on this. In my
>config I always had this compiled into the kernel so I didn't notice
>that the always-on property is missing.

Hm. So any cpu core voltage has to have the "always-on" property? On any SoC? Shouldn't there be some code to prevent the disabling of the voltage if the cpu nodes have a cpu-supply phandle?

-michael


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-20  7:43               ` Michael Walle
@ 2021-09-20  8:10                 ` Lucas Stach
  -1 siblings, 0 replies; 24+ messages in thread
From: Lucas Stach @ 2021-09-20  8:10 UTC (permalink / raw)
  To: Michael Walle, Frieder Schrempf, Heiko Thiery
  Cc: devicetree, Guido Günther, Fabio Estevam, Shengjiu Wang,
	Angus Ainslie (Purism),
	linux-kernel, Krzysztof Kozlowski, Joakim Zhang, Rob Herring,
	NXP Linux Team, Pengutronix Kernel Team, Shawn Guo, Sascha Hauer,
	linux-arm-kernel

Am Montag, dem 20.09.2021 um 09:43 +0200 schrieb Michael Walle:
> Am 20. September 2021 09:31:20 MESZ schrieb Frieder Schrempf <frieder.schrempf@kontron.de>:
> > On 17.09.21 18:10, Heiko Thiery wrote:
> > > Hi Lucas,
> > > 
> > > Am Fr., 17. Sept. 2021 um 13:44 Uhr schrieb Lucas Stach
> > > <l.stach@pengutronix.de>:
> > > > 
> > > > Am Freitag, dem 17.09.2021 um 09:28 +0200 schrieb Heiko Thiery:
> > > > > Hi Frieder,
> > > > > 
> > > > > Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
> > > > > <frieder.schrempf@kontron.de>:
> > > > > > 
> > > > > > On 15.09.21 14:05, Michael Walle wrote:
> > > > > > > Am 2021-09-15 14:03, schrieb Heiko Thiery:
> > > > > > > > The buck2 output of the PMIC is the VDD core voltage of the cpu.
> > > > > > > > Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> > > > > > > > property to avoid this.
> > > > > > > 
> > > > > > > Mh, have this ever worked? Is there a commit which introduced a regression?
> > > > > > 
> > > > > > Yes, this did work before, even without 'regulator-always-on'. I
> > > > > > currently don't understand why this is needed. The regulator is
> > > > > > referenced in the CPU nodes as 'cpu-supply'. This should be enough to
> > > > > > not disable it as long as the CPU is up.
> > > > > 
> > > > > I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
> > > > > same issue:
> > > > > 
> > > > > [ 31.716031] vdd-5v: disabling
> > > > > [ 31.719032] rst-usb-eth2: disabling
> > > > > [ 31.722553] buck2: disabling
> > > > > 
> > > > > While on that I tried to compare with other boards and see that they
> > > > > also have the cpu-voltage marked as "regulator-always-on". The only
> > > > > exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
> > > > > has not set this property.
> > > > > 
> > > > > I agree with you and don't understand why this is happening. Has
> > > > > anyone else an explanation?
> > > > > 
> > > > > [1] https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Flatest%2Fsource%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx8mq-librem5-devkit.dts%23L319&amp;data=04%7C01%7Cfrieder.schrempf%40kontron.de%7Cce9d266ad78a4d06721008d979f5aeed%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637674918380815550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PsTKX4MXGwvvP6WxmQ1OWc8e32YI6Nsu%2FEkcNR4V8is%3D&amp;reserved=0
> > > > > 
> > > > Maybe your kernel config is missing the cpufreq driver, so you don't
> > > > have a consumer of the regulator?
> > > > 
> > > > Marking the regulator as always-on seems like the right thing to do,
> > > > you don't want to depend on a consumer showing up to make sure that
> > > > your CPU voltage isn't cut...
> > > 
> > > shouldn't it be that the node cpu-supply here is a consumer of the
> > > referenced voltage?
> > 
> > Yes, but as Michael and Lucas noted, the consumer is only active if the
> > cpufreq driver is loaded and we don't want to depend on this. In my
> > config I always had this compiled into the kernel so I didn't notice
> > that the always-on property is missing.
> 
> Hm. So any cpu core voltage has to have the "always-on" property? On
> any SoC? Shouldn't there be some code to prevent the disabling of the
> voltage if the cpu nodes have a cpu-supply phandle?

Yes, all regulators that must not be shut down for proper system
operation must be marked as always-on. Just because it is a CPU supply
doesn't make it special in any way. Otherwise where would you stop with
adding special code to keep supplies enabled without a consumer? Have
code to keep the DDR memory regulators on when no DDR controller driver
is loaded? Code to keep 3.3V for the board level peripherals enabled?
Just mark those as always-on.

Regards,
Lucas


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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-09-20  8:10                 ` Lucas Stach
  0 siblings, 0 replies; 24+ messages in thread
From: Lucas Stach @ 2021-09-20  8:10 UTC (permalink / raw)
  To: Michael Walle, Frieder Schrempf, Heiko Thiery
  Cc: devicetree, Guido Günther, Fabio Estevam, Shengjiu Wang,
	Angus Ainslie (Purism),
	linux-kernel, Krzysztof Kozlowski, Joakim Zhang, Rob Herring,
	NXP Linux Team, Pengutronix Kernel Team, Shawn Guo, Sascha Hauer,
	linux-arm-kernel

Am Montag, dem 20.09.2021 um 09:43 +0200 schrieb Michael Walle:
> Am 20. September 2021 09:31:20 MESZ schrieb Frieder Schrempf <frieder.schrempf@kontron.de>:
> > On 17.09.21 18:10, Heiko Thiery wrote:
> > > Hi Lucas,
> > > 
> > > Am Fr., 17. Sept. 2021 um 13:44 Uhr schrieb Lucas Stach
> > > <l.stach@pengutronix.de>:
> > > > 
> > > > Am Freitag, dem 17.09.2021 um 09:28 +0200 schrieb Heiko Thiery:
> > > > > Hi Frieder,
> > > > > 
> > > > > Am Mi., 15. Sept. 2021 um 14:09 Uhr schrieb Frieder Schrempf
> > > > > <frieder.schrempf@kontron.de>:
> > > > > > 
> > > > > > On 15.09.21 14:05, Michael Walle wrote:
> > > > > > > Am 2021-09-15 14:03, schrieb Heiko Thiery:
> > > > > > > > The buck2 output of the PMIC is the VDD core voltage of the cpu.
> > > > > > > > Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> > > > > > > > property to avoid this.
> > > > > > > 
> > > > > > > Mh, have this ever worked? Is there a commit which introduced a regression?
> > > > > > 
> > > > > > Yes, this did work before, even without 'regulator-always-on'. I
> > > > > > currently don't understand why this is needed. The regulator is
> > > > > > referenced in the CPU nodes as 'cpu-supply'. This should be enough to
> > > > > > not disable it as long as the CPU is up.
> > > > > 
> > > > > I rechecked that with 5.11, 5.10 and 5.9 and I see on all of them the
> > > > > same issue:
> > > > > 
> > > > > [ 31.716031] vdd-5v: disabling
> > > > > [ 31.719032] rst-usb-eth2: disabling
> > > > > [ 31.722553] buck2: disabling
> > > > > 
> > > > > While on that I tried to compare with other boards and see that they
> > > > > also have the cpu-voltage marked as "regulator-always-on". The only
> > > > > exception in dts/freescale is in imx8mq-librem5-devkit.dts [1] that
> > > > > has not set this property.
> > > > > 
> > > > > I agree with you and don't understand why this is happening. Has
> > > > > anyone else an explanation?
> > > > > 
> > > > > [1] https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Flatest%2Fsource%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx8mq-librem5-devkit.dts%23L319&amp;data=04%7C01%7Cfrieder.schrempf%40kontron.de%7Cce9d266ad78a4d06721008d979f5aeed%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637674918380815550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PsTKX4MXGwvvP6WxmQ1OWc8e32YI6Nsu%2FEkcNR4V8is%3D&amp;reserved=0
> > > > > 
> > > > Maybe your kernel config is missing the cpufreq driver, so you don't
> > > > have a consumer of the regulator?
> > > > 
> > > > Marking the regulator as always-on seems like the right thing to do,
> > > > you don't want to depend on a consumer showing up to make sure that
> > > > your CPU voltage isn't cut...
> > > 
> > > shouldn't it be that the node cpu-supply here is a consumer of the
> > > referenced voltage?
> > 
> > Yes, but as Michael and Lucas noted, the consumer is only active if the
> > cpufreq driver is loaded and we don't want to depend on this. In my
> > config I always had this compiled into the kernel so I didn't notice
> > that the always-on property is missing.
> 
> Hm. So any cpu core voltage has to have the "always-on" property? On
> any SoC? Shouldn't there be some code to prevent the disabling of the
> voltage if the cpu nodes have a cpu-supply phandle?

Yes, all regulators that must not be shut down for proper system
operation must be marked as always-on. Just because it is a CPU supply
doesn't make it special in any way. Otherwise where would you stop with
adding special code to keep supplies enabled without a consumer? Have
code to keep the DDR memory regulators on when no DDR controller driver
is loaded? Code to keep 3.3V for the board level peripherals enabled?
Just mark those as always-on.

Regards,
Lucas


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
  2021-09-15 12:03 ` Heiko Thiery
@ 2021-10-04 12:39   ` Shawn Guo
  -1 siblings, 0 replies; 24+ messages in thread
From: Shawn Guo @ 2021-10-04 12:39 UTC (permalink / raw)
  To: Heiko Thiery
  Cc: devicetree, linux-arm-kernel, linux-kernel, Krzysztof Kozlowski,
	Michael Walle, Joakim Zhang, Shengjiu Wang, Rob Herring,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Frieder Schrempf

On Wed, Sep 15, 2021 at 02:03:26PM +0200, Heiko Thiery wrote:
> The buck2 output of the PMIC is the VDD core voltage of the cpu.
> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> property to avoid this.
> 
> Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards")
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

Applied, thanks!

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

* Re: [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
@ 2021-10-04 12:39   ` Shawn Guo
  0 siblings, 0 replies; 24+ messages in thread
From: Shawn Guo @ 2021-10-04 12:39 UTC (permalink / raw)
  To: Heiko Thiery
  Cc: devicetree, linux-arm-kernel, linux-kernel, Krzysztof Kozlowski,
	Michael Walle, Joakim Zhang, Shengjiu Wang, Rob Herring,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Frieder Schrempf

On Wed, Sep 15, 2021 at 02:03:26PM +0200, Heiko Thiery wrote:
> The buck2 output of the PMIC is the VDD core voltage of the cpu.
> Switching off this will poweroff the CPU. Add the 'regulator-always-on'
> property to avoid this.
> 
> Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards")
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

Applied, thanks!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-10-04 12:41 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 12:03 [PATCH] arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2 Heiko Thiery
2021-09-15 12:03 ` Heiko Thiery
2021-09-15 12:05 ` Michael Walle
2021-09-15 12:05   ` Michael Walle
2021-09-15 12:09   ` Frieder Schrempf
2021-09-15 12:09     ` Frieder Schrempf
2021-09-17  7:28     ` Heiko Thiery
2021-09-17  7:28       ` Heiko Thiery
2021-09-17  8:21       ` Michael Walle
2021-09-17  8:21         ` Michael Walle
2021-09-17  8:51         ` Heiko Thiery
2021-09-17  8:51           ` Heiko Thiery
2021-09-17 11:44       ` Lucas Stach
2021-09-17 11:44         ` Lucas Stach
2021-09-17 16:10         ` Heiko Thiery
2021-09-17 16:10           ` Heiko Thiery
2021-09-20  7:31           ` Frieder Schrempf
2021-09-20  7:31             ` Frieder Schrempf
2021-09-20  7:43             ` Michael Walle
2021-09-20  7:43               ` Michael Walle
2021-09-20  8:10               ` Lucas Stach
2021-09-20  8:10                 ` Lucas Stach
2021-10-04 12:39 ` Shawn Guo
2021-10-04 12:39   ` Shawn Guo

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.