2022-08-25 16:45:55

by Doug Anderson

[permalink] [raw]
Subject: [PATCH 1/7] arm64: dts: qcom: sa8155p-adp: Specify which LDO modes are allowed

This board uses RPMH, specifies "regulator-allow-set-load" for LDOs,
but doesn't specify any modes with "regulator-allowed-modes".

Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement
get_optimum_mode(), not set_load()") the above meant that we were able
to set either LPM or HPM mode. After that commit (and fixes [1]) we'll
be stuck at the initial mode. Discussion of this has resulted in the
decision that the old dts files were wrong and should be fixed to
fully restore old functionality.

Let's re-enable the old functionality by fixing the dts.

[1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid

Fixes: 5b85e8f2225c ("arm64: dts: qcom: sa8155p-adp: Add base dts file")
Signed-off-by: Douglas Anderson <[email protected]>
---

arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
index ba547ca9fc6b..ddb9cb182152 100644
--- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
+++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
@@ -43,7 +43,6 @@ vreg_s4a_1p8: smps4 {

regulator-always-on;
regulator-boot-on;
- regulator-allow-set-load;

vin-supply = <&vreg_3p3>;
};
@@ -137,6 +136,9 @@ vreg_l5a_0p88: ldo5 {
regulator-max-microvolt = <880000>;
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
regulator-allow-set-load;
+ regulator-allowed-modes =
+ <RPMH_REGULATOR_MODE_LPM
+ RPMH_REGULATOR_MODE_HPM>;
};

vreg_l7a_1p8: ldo7 {
@@ -152,6 +154,9 @@ vreg_l10a_2p96: ldo10 {
regulator-max-microvolt = <2960000>;
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
regulator-allow-set-load;
+ regulator-allowed-modes =
+ <RPMH_REGULATOR_MODE_LPM
+ RPMH_REGULATOR_MODE_HPM>;
};

vreg_l11a_0p8: ldo11 {
@@ -258,6 +263,9 @@ vreg_l5c_1p2: ldo5 {
regulator-max-microvolt = <1200000>;
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
regulator-allow-set-load;
+ regulator-allowed-modes =
+ <RPMH_REGULATOR_MODE_LPM
+ RPMH_REGULATOR_MODE_HPM>;
};

vreg_l7c_1p8: ldo7 {
@@ -273,6 +281,9 @@ vreg_l8c_1p2: ldo8 {
regulator-max-microvolt = <1200000>;
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
regulator-allow-set-load;
+ regulator-allowed-modes =
+ <RPMH_REGULATOR_MODE_LPM
+ RPMH_REGULATOR_MODE_HPM>;
};

vreg_l10c_3p3: ldo10 {
--
2.37.2.672.g94769d06f0-goog


2022-08-25 22:18:28

by Andrew Halaney

[permalink] [raw]
Subject: Re: [PATCH 1/7] arm64: dts: qcom: sa8155p-adp: Specify which LDO modes are allowed

On Thu, Aug 25, 2022 at 09:41:59AM -0700, Douglas Anderson wrote:
> This board uses RPMH, specifies "regulator-allow-set-load" for LDOs,
> but doesn't specify any modes with "regulator-allowed-modes".
>
> Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement
> get_optimum_mode(), not set_load()") the above meant that we were able
> to set either LPM or HPM mode. After that commit (and fixes [1]) we'll
> be stuck at the initial mode. Discussion of this has resulted in the
> decision that the old dts files were wrong and should be fixed to
> fully restore old functionality.
>
> Let's re-enable the old functionality by fixing the dts.
>
> [1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid
>
> Fixes: 5b85e8f2225c ("arm64: dts: qcom: sa8155p-adp: Add base dts file")
> Signed-off-by: Douglas Anderson <[email protected]>
> ---
>
> arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
> index ba547ca9fc6b..ddb9cb182152 100644
> --- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
> +++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
> @@ -43,7 +43,6 @@ vreg_s4a_1p8: smps4 {
>
> regulator-always-on;
> regulator-boot-on;
> - regulator-allow-set-load;

I could see this deserving its own commit or a line in the commit
message, but not a big deal to me:

Reviewed-by: Andrew Halaney <[email protected]>

>
> vin-supply = <&vreg_3p3>;
> };
> @@ -137,6 +136,9 @@ vreg_l5a_0p88: ldo5 {
> regulator-max-microvolt = <880000>;
> regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> regulator-allow-set-load;
> + regulator-allowed-modes =
> + <RPMH_REGULATOR_MODE_LPM
> + RPMH_REGULATOR_MODE_HPM>;
> };
>
> vreg_l7a_1p8: ldo7 {
> @@ -152,6 +154,9 @@ vreg_l10a_2p96: ldo10 {
> regulator-max-microvolt = <2960000>;
> regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> regulator-allow-set-load;
> + regulator-allowed-modes =
> + <RPMH_REGULATOR_MODE_LPM
> + RPMH_REGULATOR_MODE_HPM>;
> };
>
> vreg_l11a_0p8: ldo11 {
> @@ -258,6 +263,9 @@ vreg_l5c_1p2: ldo5 {
> regulator-max-microvolt = <1200000>;
> regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> regulator-allow-set-load;
> + regulator-allowed-modes =
> + <RPMH_REGULATOR_MODE_LPM
> + RPMH_REGULATOR_MODE_HPM>;
> };
>
> vreg_l7c_1p8: ldo7 {
> @@ -273,6 +281,9 @@ vreg_l8c_1p2: ldo8 {
> regulator-max-microvolt = <1200000>;
> regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> regulator-allow-set-load;
> + regulator-allowed-modes =
> + <RPMH_REGULATOR_MODE_LPM
> + RPMH_REGULATOR_MODE_HPM>;
> };
>
> vreg_l10c_3p3: ldo10 {
> --
> 2.37.2.672.g94769d06f0-goog
>

2022-08-25 22:40:33

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH 1/7] arm64: dts: qcom: sa8155p-adp: Specify which LDO modes are allowed

Hi,

On Thu, Aug 25, 2022 at 2:31 PM Andrew Halaney <[email protected]> wrote:
>
> On Thu, Aug 25, 2022 at 09:41:59AM -0700, Douglas Anderson wrote:
> > This board uses RPMH, specifies "regulator-allow-set-load" for LDOs,
> > but doesn't specify any modes with "regulator-allowed-modes".
> >
> > Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement
> > get_optimum_mode(), not set_load()") the above meant that we were able
> > to set either LPM or HPM mode. After that commit (and fixes [1]) we'll
> > be stuck at the initial mode. Discussion of this has resulted in the
> > decision that the old dts files were wrong and should be fixed to
> > fully restore old functionality.
> >
> > Let's re-enable the old functionality by fixing the dts.
> >
> > [1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid
> >
> > Fixes: 5b85e8f2225c ("arm64: dts: qcom: sa8155p-adp: Add base dts file")
> > Signed-off-by: Douglas Anderson <[email protected]>
> > ---
> >
> > arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 13 ++++++++++++-
> > 1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
> > index ba547ca9fc6b..ddb9cb182152 100644
> > --- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
> > +++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
> > @@ -43,7 +43,6 @@ vreg_s4a_1p8: smps4 {
> >
> > regulator-always-on;
> > regulator-boot-on;
> > - regulator-allow-set-load;
>
> I could see this deserving its own commit or a line in the commit
> message, but not a big deal to me:
>
> Reviewed-by: Andrew Halaney <[email protected]>

Ah right. I mentioned it in the cover letter but forgot to mention it
in this commit message.

I'll assume that this isn't a big deal but if Bjorn wants a quick spin
with this mentioned in the commit message (or broken into a separate
commit) then I can do so. I'll wait for direction before spinning,
though.

-Doug

2022-08-26 18:52:15

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 1/7] arm64: dts: qcom: sa8155p-adp: Specify which LDO modes are allowed



On 25.08.2022 18:41, Douglas Anderson wrote:
> This board uses RPMH, specifies "regulator-allow-set-load" for LDOs,
> but doesn't specify any modes with "regulator-allowed-modes".
>
> Prior to commit efb0cb50c427 ("regulator: qcom-rpmh: Implement
> get_optimum_mode(), not set_load()") the above meant that we were able
> to set either LPM or HPM mode. After that commit (and fixes [1]) we'll
> be stuck at the initial mode. Discussion of this has resulted in the
> decision that the old dts files were wrong and should be fixed to
> fully restore old functionality.
>
> Let's re-enable the old functionality by fixing the dts.
>
> [1] https://lore.kernel.org/r/20220824142229.RFT.v2.2.I6f77860e5cd98bf5c67208fa9edda4a08847c304@changeid
>
> Fixes: 5b85e8f2225c ("arm64: dts: qcom: sa8155p-adp: Add base dts file")
> Signed-off-by: Douglas Anderson <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad

>
> arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
> index ba547ca9fc6b..ddb9cb182152 100644
> --- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
> +++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
> @@ -43,7 +43,6 @@ vreg_s4a_1p8: smps4 {
>
> regulator-always-on;
> regulator-boot-on;
> - regulator-allow-set-load;
>
> vin-supply = <&vreg_3p3>;
> };
> @@ -137,6 +136,9 @@ vreg_l5a_0p88: ldo5 {
> regulator-max-microvolt = <880000>;
> regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> regulator-allow-set-load;
> + regulator-allowed-modes =
> + <RPMH_REGULATOR_MODE_LPM
> + RPMH_REGULATOR_MODE_HPM>;
> };
>
> vreg_l7a_1p8: ldo7 {
> @@ -152,6 +154,9 @@ vreg_l10a_2p96: ldo10 {
> regulator-max-microvolt = <2960000>;
> regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> regulator-allow-set-load;
> + regulator-allowed-modes =
> + <RPMH_REGULATOR_MODE_LPM
> + RPMH_REGULATOR_MODE_HPM>;
> };
>
> vreg_l11a_0p8: ldo11 {
> @@ -258,6 +263,9 @@ vreg_l5c_1p2: ldo5 {
> regulator-max-microvolt = <1200000>;
> regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> regulator-allow-set-load;
> + regulator-allowed-modes =
> + <RPMH_REGULATOR_MODE_LPM
> + RPMH_REGULATOR_MODE_HPM>;
> };
>
> vreg_l7c_1p8: ldo7 {
> @@ -273,6 +281,9 @@ vreg_l8c_1p2: ldo8 {
> regulator-max-microvolt = <1200000>;
> regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> regulator-allow-set-load;
> + regulator-allowed-modes =
> + <RPMH_REGULATOR_MODE_LPM
> + RPMH_REGULATOR_MODE_HPM>;
> };
>
> vreg_l10c_3p3: ldo10 {