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: <622b1887-6738-41d6-a8a8-37690cc0c63e@ixit.cz>
Date: Thu, 20 Mar 2025 01:14:03 +0100
From: David Heidelberg <david@...t.cz>
To: Sebastian Reichel <sebastian.reichel@...labora.com>
Cc: Sakari Ailus <sakari.ailus@...ux.intel.com>,
 Mauro Carvalho Chehab <mchehab@...nel.org>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Pavel Machek <pavel@...nel.org>,
 Pavel Machek <pavel@....cz>, linux-media@...r.kernel.org,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] media: dt-bindings: Convert Analog Devices ad5820 to
 DT schema

On 15/03/2025 16:49, Sebastian Reichel wrote:
> Hello,
> 
> On Sat, Mar 15, 2025 at 02:18:40PM +0100, David Heidelberg wrote:
>> On 14/03/2025 21:57, Sakari Ailus wrote:
>>> Thanks for converting this to YAML.
>>>
>>> On Fri, Mar 14, 2025 at 08:58:27PM +0100, David Heidelberg via B4 Relay wrote:
>>>> From: David Heidelberg <david@...t.cz>
>>>>
>>>> Convert the Analog Devices ad5820 to DT schema format.
>>>>
>>>> Add the previously undocumented io-channel-cells property,
>>>> which can be omitted. If present, it must be set to 0,
>>>> as the device provides only one channel.
>>>
>>> What's the purpose of this property? The driver doesn't use it nor I think
>>> it provides any information on the hardware either. The above description
>>> also appears to be saying it's redundant.
>>
>> Hello Sakari,
>>
>> from my understanding, you're right.
>>
>> I would prefer to drop it, see [1].
>>
>> Anyway from reading of documentation I understood it may be right to have
>> the property empty, but also may be omitted. I saw both approaches in the
>> code.
>>
>> If you choose not liking this redudancy, I push [1] and drop the property
>> here.
>>
>> David
>>
>> [1] https://patchwork.kernel.org/project/linux-omap/patch/20250213203208.93316-1-david@ixit.cz/
> 
> Like all DT properties starting with #, this is not about hardware,
> but about parsing the device tree itself and used by core DT code:
> 
> $ git grep io-channels drivers/of/property.c
> drivers/of/property.c:DEFINE_SIMPLE_PROP(io_channels, "io-channels", "#io-channel-cells")
> 
> Have a look at the following example DT:
> 
> iio_device1: iio-provider1 {
>      #io-channel-cells = <2>;
> };
> 
> iio_device2: iio-provider2 {
>      #io-channel-cells = <1>;
> };
> 
> iio_device3: iio-provider3 {
>      #io-channel-cells = <0>;
> };
> 
> example-iio-user {
>      my-iio-reference = <&iio_device1 AREA0 CHANNEL2>, <&iio_device3>, <&iio_device2 CHAN0>;
> };
> 
> While you can easily understand that without the io-channel-cells,
> please have a look what it looks like after sending it through the
> DT compiler. You will get something like this:
> 
> iio-provider1 {
>      #io-channel-cells = <2>;
>      phandle = <23>;
> };
> 
> iio-provider2 {
>      #io-channel-cells = <1>;
>      phandle = <10>;
> };
> 
> iio-provider3 {
>      #io-channel-cells = <0>;
>      phandle = <37>;
> };
> 
> example-iio-user {
>      my-iio-reference = <23 42 13 37 10 0>;
> };
> 
> But you can safely drop it, when there are no references to the IIO
> device. So it's obviously not required in all cases.
> 
> I hope I could explain the purpose well enough :)

This looks like a very good explanation, it helped me a lot.

Any chance to sneak it into the docs somewhere?

David

> 
> Greetings,
> 
> -- Sebastian

-- 
David Heidelberg


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ