lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YmwBzLrTilOPdX5m@robh.at.kernel.org>
Date:   Fri, 29 Apr 2022 10:18:36 -0500
From:   Rob Herring <robh@...nel.org>
To:     Thierry Reding <thierry.reding@...il.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Krzysztof Kozlowski <krzk+dt@...nel.org>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Avi Fishman <avifishman70@...il.com>,
        Tomer Maimon <tmaimon77@...il.com>,
        Tali Perry <tali.perry1@...il.com>,
        Patrick Venture <venture@...gle.com>,
        Nancy Yuen <yuenn@...gle.com>,
        Benjamin Fair <benjaminfair@...gle.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        linux-stm32@...md-mailman.stormreply.com, soc@...nel.org,
        devicetree@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RESEND PATCH] arm64: dts: tegra: Fix boolean properties with
 values

On Tue, Apr 12, 2022 at 11:05:15AM +0200, Thierry Reding wrote:
> On Wed, Apr 06, 2022 at 02:17:30PM -0500, Rob Herring wrote:
> > Boolean properties in DT are present or not present and don't take a value.
> > A property such as 'foo = <0>;' evaluated to true. IOW, the value doesn't
> > matter.
> > 
> > It may have been intended that 0 values are false, but there is no change
> > in behavior with this patch.
> > 
> > Signed-off-by: Rob Herring <robh@...nel.org>
> > ---
> > Can someone apply this for 5.18.
> > 
> >  arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi            | 8 ++++----
> >  .../boot/dts/nvidia/tegra186-p3509-0000+p3636-0001.dts    | 8 ++++----
> >  arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi            | 6 +++---
> >  arch/arm64/boot/dts/nvidia/tegra194-p3668.dtsi            | 6 +++---
> >  arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi            | 6 +++---
> >  arch/arm64/boot/dts/nvidia/tegra210-p2894.dtsi            | 8 ++++----
> >  arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts        | 8 ++++----
> >  arch/arm64/boot/dts/nvidia/tegra210-smaug.dts             | 4 ++--
> >  8 files changed, 27 insertions(+), 27 deletions(-)
> 
> This causes multiple regressions on Tegra boards. The reason for this is
> that these properties are not in fact boolean, despite what the DT
> bindings say. If you look at the code that handles these, you'll notice
> that they are single-cell properties, typically with <0> and <1> values.
> What may have led to the conclusion that these are boolean is that there
> is also a special case where these can be left out, but the meaning of
> that is not the "false" (<0>) value. Instead, leaving these out means
> that the values should be left at whatever is currently in the register.

The majority of users do use boolean in their DT.

Treating these as tri-state doesn't make much sense because what does 
setting the pin to !push-pull mean? Isn't that just open-drain or 
open-source for which also have boolean values? Allowing these to have 
values is unnecessary and enables more invalid combinations.

> See pinconf_generic_parse_dt_config() and parse_dt_cfg() specifically in
> drivers/pinctrl/pinconf-generic.c.

of_property_read_u32() will return -EOVERFLOW on a boolean value and 
then the default value (0) is used. However, at least for QCom the value 
is ignored.

Looking at max77620, the value is used. However, it is clear that 
push-pull and open-drain operate on the same register bit.

> Arnd, can you please revert this so that these boards can be unbroken?

That's fine for now...

> It's a bit unfortunate because there seem to be other platforms that
> also employ these in the boolean form that Rob mentioned, but I think it
> is those that probably need fixing instead. Not sure what the intentions
> were for those.

I still think it's Tegra that needs fixing. The question is to what 
extent forwards and backwards compatibity is needed on these platforms? 
I'm not sure if we can fix new dtb with old kernel. A new dtb with a 
stable kernel update would be plausible. It may work just replacing 
'drive-push-pull = <0>' cases with 'drive-open-drain'.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ