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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <df5b2e1a-dca2-7827-7066-4e6f3dd8fcab@axentia.se>
Date: Thu, 4 Sep 2025 13:20:09 +0200
From: Peter Rosin <peda@...ntia.se>
To: Krzysztof Kozlowski <krzk@...nel.org>,
 Primoz Fiser <primoz.fiser@...ik.com>
Cc: Jonathan Cameron <jic23@...nel.org>, David Lechner
 <dlechner@...libre.com>, Nuno Sa <nuno.sa@...log.com>,
 Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
 Sascha Hauer <s.hauer@...gutronix.de>,
 Pengutronix Kernel Team <kernel@...gutronix.de>,
 Fabio Estevam <festevam@...il.com>, linux-iio@...r.kernel.org,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
 imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
 upstream@...ts.phytec.de
Subject: Re: [PATCH 1/2] dt-bindings: iio: afe: current-sense-amplifier: Add
 io-channel-cells

Hi!

2025-09-04 at 12:44, Krzysztof Kozlowski wrote:
> On 04/09/2025 12:15, Primoz Fiser wrote:
>> Hi Krzysztof,
>>
>> On 4. 09. 25 11:17, Krzysztof Kozlowski wrote:
>>> On Wed, Sep 03, 2025 at 01:36:59PM +0200, Primoz Fiser wrote:
>>>> The current-sense-amplifier is an IIO provider thus can be referenced by
>>>> IIO consumers (via "io-channels" property in consumer device node). Such
>>>> provider is required to describe number of cells used in phandle lookup
>>>> with "io-channel-cells" property, otherwise the following kernel error
>>>> is present:
>>>>
>>>>    OF: /iio-hwmon: could not get #io-channel-cells for /current-sense
>>>
>>> Also, how can I reproduce this error? Do you paste here real errors or
>>> just some invented ones from some out of tree code (hint: such would not
>>> be relevant).
>>
>> I get this error if I apply patch #2 without patch #1. See [1] for more 
>> details.
> Then your warning is not relevant here.
> 
> You said in your commit there is a bug, expressed with that warning, so
> you make this commit. Turns out there is no bug, so all the reasons for
> this commit are gone.
> 
> Rephrase the commit msg to describe accurate reasons WHY you are doing
> this. Drop non-existing warnings and any misleading fixes tag, since
> there is no bug being fixed.

If it's a bug in the conversion or not could be debated. With the old
txt binding it was allowed to add #io-channel-cells, after the yaml
conversion it is no longer allowed to do so. It has always been the
intention that there is an option to add an #io-channel-cells property,
so you could of course claim that the bug was also present in the txt
binding. However, when the txt binding was written, that fact was
implied from the generic iio-bindings.txt which had this in it:

==IIO providers==

Required properties:
#io-channel-cells: Number of cells in an IIO specifier; Typically 0 for nodes
		   with a single IIO output and 1 for nodes with multiple
		   IIO outputs.

So, I claim that the conversion commit is at fault, since it locked
things down (additionalProperties: false) with unintended consequences.

For reference, see commit
f1f99fcbf997 ("dt-bindings: iio: afe: voltage-divider: Add io-channel-cells")
which unfortunately locks the cell count to 1 which is bogus as 0 is
the natural cell count for all the bindings backed by the rescaler
driver. They all have only one output.

Cheers,
Peter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ