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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 25 Jun 2020 07:13:02 +0100
From:   Lee Jones <lee.jones@...aro.org>
To:     Frank Rowand <frowand.list@...il.com>
Cc:     Michael Walle <michael@...le.cc>, Rob Herring <robh+dt@...nel.org>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Mark Brown <broonie@...nel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Guenter Roeck <linux@...ck-us.net>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Robin Murphy <robin.murphy@....com>,
        GregKroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [RFC] MFD's relationship with Device Tree (OF)

On Wed, 24 Jun 2020, Frank Rowand wrote:
> On 2020-06-22 16:03, Michael Walle wrote:
> > Am 2020-06-14 12:26, schrieb Michael Walle:
> >> Hi Rob,
> >>
> >> Am 2020-06-10 00:03, schrieb Rob Herring:
> >> [..]
> >>> Yes, we should use 'reg' whenever possible. If we don't have 'reg',
> >>> then you shouldn't have a unit-address either and you can simply match
> >>> on the node name (standard DT driver matching is with compatible,
> >>> device_type, and node name (w/o unit-address)). We've generally been
> >>> doing 'classname-N' when there's no 'reg' to do 'classname@N'.
> >>> Matching on 'classname-N' would work with node name matching as only
> >>> unit-addresses are stripped.
> >>
> >> This still keeps me thinking. Shouldn't we allow the (MFD!) device
> >> driver creator to choose between "classname@N" and "classname-N".
> >> In most cases N might not be made up, but it is arbitrarily chosen;
> >> for example you've chosen the bank for the ab8500 reg. It is not
> >> a defined entity, like an I2C address if your parent is an I2C bus,
> >> or a SPI chip select, or the memory address in case of MMIO. Instead
> >> the device driver creator just chooses some "random" property from
> >> the datasheet; another device creator might have chosen another
> >> property. Wouldn't it make more sense, to just say this MFD provides
> >> N pwm devices and the subnodes are matching based on pwm-{0,1..N-1}?
> >> That would also be the logical consequence of the current MFD sub
> >> device to OF node matching code, which just supports N=1.

It's funny.  You reiterate things like "arbitrarily chosen" and
"randomly chosen from the datasheet" but yet your suggestion is just
that.  The only difference is that you wish to place the numerical
differentiator in the node name, rather than the reg property.  Worse
still, you are suggesting that you wish to just enumerate them off
sequentially from some arbitrary base (likely 0).

I don't know of many cases off, the top of my head at least, where
this is a problem.  As you've mentioned, in the case of the AB8500,
the bank is used which is semantically how the devices are actually
addressed.  It's not random, it's physical.

How are the identical devices addressed/identified/differentiated
from each other on your H/W?  You must have a way of saying "I want
PWM X to act in a different way from PWM Y".  What is 'X' and 'Y' in
your datasheet?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ