2019-07-22 15:39:11

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 0/5] arm64: dts: qcom: sdm845: Fix DTS warnings

So this is an attempt to fix some warns on sdm845 dts. We still have bunch
of warnings to fix after this series (dupplicate adress and node names
having underscores etc).

lets get long hanging ones fixed, we can see the warns with W=1 or W=2

Vinod Koul (5):
arm64: dts: qcom: sdm845: Add unit name to soc node
arm64: dts: qcom: sdm845: remove unnecessary properties for dsi nodes
arm64: dts: qcom: sdm845: remove unit name for thermal trip points
arm64: dts: qcom: sdm845: remove macro from unit name
arm64: dts: qcom: sdm845-cheza: remove macro from unit name

arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 10 ++--
arch/arm64/boot/dts/qcom/sdm845.dtsi | 66 ++++++++++------------
3 files changed, 36 insertions(+), 42 deletions(-)

Thanks
--
2.20.1


2019-07-22 15:39:21

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 1/5] arm64: dts: qcom: sdm845: Add unit name to soc node

We get a warning about missing unit name for soc node, so add it.

arch/arm64/boot/dts/qcom/sdm845.dtsi:623.11-2814.4: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name

Signed-off-by: Vinod Koul <[email protected]>
---
arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 601cfb078bd5..e81f4a6d08ce 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -620,7 +620,7 @@
method = "smc";
};

- soc: soc {
+ soc: soc@0 {
#address-cells = <2>;
#size-cells = <2>;
ranges = <0 0 0 0 0x10 0>;
--
2.20.1

2019-07-22 15:39:23

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 2/5] arm64: dts: qcom: sdm845: remove unnecessary properties for dsi nodes

We get a warning about unnecessary properties of

arch/arm64/boot/dts/qcom/sdm845.dtsi:2211.22-2257.6: Warning (avoid_unnecessary_addr_size): /soc/mdss@ae00000/dsi@ae94000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
arch/arm64/boot/dts/qcom/sdm845.dtsi:2278.22-2324.6: Warning (avoid_unnecessary_addr_size): /soc/mdss@ae00000/dsi@ae96000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

So, remove these properties

Signed-off-by: Vinod Koul <[email protected]>
---
arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ------
1 file changed, 6 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index e81f4a6d08ce..2985df032179 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -2234,9 +2234,6 @@

status = "disabled";

- #address-cells = <1>;
- #size-cells = <0>;
-
ports {
#address-cells = <1>;
#size-cells = <0>;
@@ -2301,9 +2298,6 @@

status = "disabled";

- #address-cells = <1>;
- #size-cells = <0>;
-
ports {
#address-cells = <1>;
#size-cells = <0>;
--
2.20.1

2019-07-22 15:39:32

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 4/5] arm64: dts: qcom: sdm845: remove macro from unit name

Unit name is supposed to be a number, using a macro with hex value is
not recommended, so add the value in unit name.

arch/arm64/boot/dts/qcom/pm8998.dtsi:81.18-84.6: Warning (unit_address_format): /soc/spmi@c440000/pmic@0/adc@3100/adc-chan@0x06: unit name should not have leading "0x"
arch/arm64/boot/dts/qcom/pm8998.dtsi:81.18-84.6: Warning (unit_address_format): /soc/spmi@c440000/pmic@0/adc@3100/adc-chan@0x06: unit name should not have leading 0s

Signed-off-by: Vinod Koul <[email protected]>
---
arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/pm8998.dtsi b/arch/arm64/boot/dts/qcom/pm8998.dtsi
index 051a52df80f9..d76c8377c224 100644
--- a/arch/arm64/boot/dts/qcom/pm8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8998.dtsi
@@ -78,7 +78,7 @@
#size-cells = <0>;
#io-channel-cells = <1>;

- adc-chan@ADC5_DIE_TEMP {
+ adc-chan@6{
reg = <ADC5_DIE_TEMP>;
label = "die_temp";
};
--
2.20.1

2019-07-22 15:39:34

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 5/5] arm64: dts: qcom: sdm845-cheza: remove macro from unit name

Unit name is supposed to be a number, using a macro with hex value is
not recommended, so add the value in unit name.

arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:966.16-969.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4d: unit name should not have leading "0x"
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:971.16-974.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4e: unit name should not have leading "0x"
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:976.16-979.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4f: unit name should not have leading "0x"
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:981.16-984.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x50: unit name should not have leading "0x"
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:986.16-989.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x51: unit name should not have leading "0x"

Signed-off-by: Vinod Koul <[email protected]>
---
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
index 1ebbd568dfd7..9b27b8346ba1 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
@@ -963,27 +963,27 @@ ap_ts_i2c: &i2c14 {
};

&pm8998_adc {
- adc-chan@ADC5_AMUX_THM1_100K_PU {
+ adc-chan@4d {
reg = <ADC5_AMUX_THM1_100K_PU>;
label = "sdm_temp";
};

- adc-chan@ADC5_AMUX_THM2_100K_PU {
+ adc-chan@4e {
reg = <ADC5_AMUX_THM2_100K_PU>;
label = "quiet_temp";
};

- adc-chan@ADC5_AMUX_THM3_100K_PU {
+ adc-chan@4f {
reg = <ADC5_AMUX_THM3_100K_PU>;
label = "lte_temp_1";
};

- adc-chan@ADC5_AMUX_THM4_100K_PU {
+ adc-chan@50 {
reg = <ADC5_AMUX_THM4_100K_PU>;
label = "lte_temp_2";
};

- adc-chan@ADC5_AMUX_THM5_100K_PU {
+ adc-chan@51 {
reg = <ADC5_AMUX_THM5_100K_PU>;
label = "charger_temp";
};
--
2.20.1

2019-07-23 09:58:51

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 5/5] arm64: dts: qcom: sdm845-cheza: remove macro from unit name

On 23-07-19, 10:38, Amit Kucheria wrote:
> On Mon, Jul 22, 2019 at 6:06 PM Vinod Koul <[email protected]> wrote:
> >
> > Unit name is supposed to be a number, using a macro with hex value is
>
> /s/name/address?

Right, will fix.

> > not recommended, so add the value in unit name.
> >
> > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:966.16-969.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4d: unit name should not have leading "0x"
> > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:971.16-974.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4e: unit name should not have leading "0x"
> > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:976.16-979.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4f: unit name should not have leading "0x"
> > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:981.16-984.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x50: unit name should not have leading "0x"
> > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:986.16-989.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x51: unit name should not have leading "0x"
> >
> > Signed-off-by: Vinod Koul <[email protected]>
> > ---
> > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
> > index 1ebbd568dfd7..9b27b8346ba1 100644
> > --- a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
> > @@ -963,27 +963,27 @@ ap_ts_i2c: &i2c14 {
> > };
> >
> > &pm8998_adc {
> > - adc-chan@ADC5_AMUX_THM1_100K_PU {
> > + adc-chan@4d {
> > reg = <ADC5_AMUX_THM1_100K_PU>;
>
> I'm a little conflicted about this change. If we're replacing the
> address with actual values, perhaps we should do that same for the reg
> property to keep them in sync? Admittedly though, it is a bit easier
> to read the macro name and figure out its meaning.

Well this was how Bjorn suggested, am okay if we do in any
other way. This fixes warning but keeps it bit readable too

Other way would be to make defines decimal values instead of hex

Any better suggestions :)

--
~Vinod

2019-07-23 13:32:34

by Amit Kucheria

[permalink] [raw]
Subject: Re: [PATCH 5/5] arm64: dts: qcom: sdm845-cheza: remove macro from unit name

On Mon, Jul 22, 2019 at 6:06 PM Vinod Koul <[email protected]> wrote:
>
> Unit name is supposed to be a number, using a macro with hex value is

/s/name/address?

> not recommended, so add the value in unit name.
>
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:966.16-969.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4d: unit name should not have leading "0x"
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:971.16-974.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4e: unit name should not have leading "0x"
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:976.16-979.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4f: unit name should not have leading "0x"
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:981.16-984.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x50: unit name should not have leading "0x"
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:986.16-989.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x51: unit name should not have leading "0x"
>
> Signed-off-by: Vinod Koul <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
> index 1ebbd568dfd7..9b27b8346ba1 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
> @@ -963,27 +963,27 @@ ap_ts_i2c: &i2c14 {
> };
>
> &pm8998_adc {
> - adc-chan@ADC5_AMUX_THM1_100K_PU {
> + adc-chan@4d {
> reg = <ADC5_AMUX_THM1_100K_PU>;

I'm a little conflicted about this change. If we're replacing the
address with actual values, perhaps we should do that same for the reg
property to keep them in sync? Admittedly though, it is a bit easier
to read the macro name and figure out its meaning.

> label = "sdm_temp";
> };
>
> - adc-chan@ADC5_AMUX_THM2_100K_PU {
> + adc-chan@4e {
> reg = <ADC5_AMUX_THM2_100K_PU>;
> label = "quiet_temp";
> };
>
> - adc-chan@ADC5_AMUX_THM3_100K_PU {
> + adc-chan@4f {
> reg = <ADC5_AMUX_THM3_100K_PU>;
> label = "lte_temp_1";
> };
>
> - adc-chan@ADC5_AMUX_THM4_100K_PU {
> + adc-chan@50 {
> reg = <ADC5_AMUX_THM4_100K_PU>;
> label = "lte_temp_2";
> };
>
> - adc-chan@ADC5_AMUX_THM5_100K_PU {
> + adc-chan@51 {
> reg = <ADC5_AMUX_THM5_100K_PU>;
> label = "charger_temp";
> };
> --
> 2.20.1
>

2019-07-23 13:38:08

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 5/5] arm64: dts: qcom: sdm845-cheza: remove macro from unit name

On Mon 22 Jul 22:14 PDT 2019, Vinod Koul wrote:

> On 23-07-19, 10:38, Amit Kucheria wrote:
> > On Mon, Jul 22, 2019 at 6:06 PM Vinod Koul <[email protected]> wrote:
> > >
> > > Unit name is supposed to be a number, using a macro with hex value is
> >
> > /s/name/address?
>
> Right, will fix.
>
> > > not recommended, so add the value in unit name.
> > >
> > > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:966.16-969.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4d: unit name should not have leading "0x"
> > > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:971.16-974.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4e: unit name should not have leading "0x"
> > > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:976.16-979.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4f: unit name should not have leading "0x"
> > > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:981.16-984.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x50: unit name should not have leading "0x"
> > > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:986.16-989.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x51: unit name should not have leading "0x"
> > >
> > > Signed-off-by: Vinod Koul <[email protected]>
> > > ---
> > > arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 10 +++++-----
> > > 1 file changed, 5 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
> > > index 1ebbd568dfd7..9b27b8346ba1 100644
> > > --- a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
> > > @@ -963,27 +963,27 @@ ap_ts_i2c: &i2c14 {
> > > };
> > >
> > > &pm8998_adc {
> > > - adc-chan@ADC5_AMUX_THM1_100K_PU {
> > > + adc-chan@4d {
> > > reg = <ADC5_AMUX_THM1_100K_PU>;

When I read this define I instantly know which channel we're referring
to. The 4d above is simply there for syntactical purposes and needs only
to be cared about if the reg is ever changed.

So I like this form.

> >
> > I'm a little conflicted about this change. If we're replacing the
> > address with actual values, perhaps we should do that same for the reg
> > property to keep them in sync? Admittedly though, it is a bit easier
> > to read the macro name and figure out its meaning.
>
> Well this was how Bjorn suggested, am okay if we do in any
> other way. This fixes warning but keeps it bit readable too
>
> Other way would be to make defines decimal values instead of hex
>

While the ePAPRR states that the unit address must match the first reg,
dtc enforces that the unit address string matches "%x" of the reg.

Regards,
Bjorn

> Any better suggestions :)
>
> --
> ~Vinod

2019-07-24 00:16:09

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 2/5] arm64: dts: qcom: sdm845: remove unnecessary properties for dsi nodes

Quoting Vinod Koul (2019-07-22 05:34:19)
> We get a warning about unnecessary properties of
>
> arch/arm64/boot/dts/qcom/sdm845.dtsi:2211.22-2257.6: Warning (avoid_unnecessary_addr_size): /soc/mdss@ae00000/dsi@ae94000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
> arch/arm64/boot/dts/qcom/sdm845.dtsi:2278.22-2324.6: Warning (avoid_unnecessary_addr_size): /soc/mdss@ae00000/dsi@ae96000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
>
> So, remove these properties
>
> Signed-off-by: Vinod Koul <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>

2019-07-24 00:18:28

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 1/5] arm64: dts: qcom: sdm845: Add unit name to soc node

Quoting Vinod Koul (2019-07-22 05:34:18)
> We get a warning about missing unit name for soc node, so add it.
>
> arch/arm64/boot/dts/qcom/sdm845.dtsi:623.11-2814.4: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name
>
> Signed-off-by: Vinod Koul <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>

> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 601cfb078bd5..e81f4a6d08ce 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -620,7 +620,7 @@
> method = "smc";
> };
>
> - soc: soc {
> + soc: soc@0 {

This is kinda sad, but ok. Maybe you can apply this fix to at least all
the qcom boards then.

> #address-cells = <2>;
> #size-cells = <2>;
> ranges = <0 0 0 0 0x10 0>;

2019-07-24 00:18:33

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 5/5] arm64: dts: qcom: sdm845-cheza: remove macro from unit name

Quoting Vinod Koul (2019-07-22 05:34:22)
> Unit name is supposed to be a number, using a macro with hex value is
> not recommended, so add the value in unit name.
>
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:966.16-969.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4d: unit name should not have leading "0x"
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:971.16-974.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4e: unit name should not have leading "0x"
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:976.16-979.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x4f: unit name should not have leading "0x"
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:981.16-984.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x50: unit name should not have leading "0x"
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi:986.16-989.4: Warning (unit_address_format): /soc@0/spmi@c440000/pmic@0/adc@3100/adc-chan@0x51: unit name should not have leading "0x"
>
> Signed-off-by: Vinod Koul <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>

2019-07-24 04:11:09

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 1/5] arm64: dts: qcom: sdm845: Add unit name to soc node

On 23-07-19, 07:50, Stephen Boyd wrote:
> Quoting Vinod Koul (2019-07-22 05:34:18)
> > We get a warning about missing unit name for soc node, so add it.
> >
> > arch/arm64/boot/dts/qcom/sdm845.dtsi:623.11-2814.4: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name
> >
> > Signed-off-by: Vinod Koul <[email protected]>
> > ---
>
> Reviewed-by: Stephen Boyd <[email protected]>

Thanks for the review
>
> > diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > index 601cfb078bd5..e81f4a6d08ce 100644
> > --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > @@ -620,7 +620,7 @@
> > method = "smc";
> > };
> >
> > - soc: soc {
> > + soc: soc@0 {
>
> This is kinda sad, but ok. Maybe you can apply this fix to at least all
> the qcom boards then.

Yeah that is the idea, start with sdm845 and 'reduce' the warns on all
qcom dts files

--
~Vinod