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]
Message-ID: <20230226133922.13ac17b1@jic23-huawei>
Date:   Sun, 26 Feb 2023 13:39:22 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc:     "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>,
        Matti Vaittinen <mazziesaccount@...il.com>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Shreeya Patel <shreeya.patel@...labora.com>,
        Zhigang Shi <Zhigang.Shi@...eon.com>,
        Paul Gazzillo <paul@...zz.com>,
        Dmitry Osipenko <dmitry.osipenko@...labora.com>,
        Liam Beguin <liambeguin@...il.com>,
        Peter Rosin <peda@...ntia.se>,
        Randy Dunlap <rdunlap@...radead.org>,
        Masahiro Yamada <masahiroy@...nel.org>,
        "linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 1/6] dt-bindings: iio: light: Support ROHM BU27034

On Thu, 23 Feb 2023 10:26:02 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org> wrote:

> On 23/02/2023 07:20, Vaittinen, Matti wrote:
> > Hi dee Ho Krzysztof,
> > 
> > Thanks for the review! It's nice you had the time to take a look on RFC :)
> > 
> > On 2/22/23 20:57, Krzysztof Kozlowski wrote:  
> >> On 22/02/2023 17:14, Matti Vaittinen wrote:  
> >>> ROHM BU27034 is an ambient light sesnor with 3 channels and 3 photo diodes
> >>> capable of detecting a very wide range of illuminance. Typical application
> >>> is adjusting LCD and backlight power of TVs and mobile phones.
> >>>
> >>> Add initial dt-bindings.  
> >>
> >> Driver can be "initial", but bindings better to be closer to complete,
> >> even if not used by the driver currently.  
> > 
> > Out of the curiosity - why is that? (Please, don't take me wrong, I am 
> > not trying to argue against this - just learn the reason behind). I 
> > can't immediately see the harm caused by adding new properties later 
> > when we learn more of hardware. (and no, I don't expect this simple IC 
> > to gain at least many properties).  
> 
> Linux drivers change, but the hardware does not, thus DTS, which
> describes the hardware, can be complete. It should be written based on
> the hardware, not based on Linux drivers. If you add incomplete
> bindings, this suggests you wrote them to match your driver, not to
> match hardware. This in turn (adjusting bindings to driver) makes them
> less portable, narrowed to one specific driver implementation and more
> ABI-break-prone later.
> 
> Imagine you that clock inputs, which you skipped in the binding, were
> actually needed but on your board they were enabled by bootloader. The
> binding is then used on other systems or by out of tree users. On your
> new system the clocks are not enabled by bootloader anymore, thus you
> add them to the binding. They are actually required for device to work,
> so you make them required. But all these other users cannot be fixed...
> 
> What's more, incomplete binding/DTS is then used together with other
> pieces - DTS and driver, e.g. via some graphs or other
> phandles/supplies/pinctrl. So some other DTS or driver code might rely
> on your particular binding. Imagine you had only vdd-supply regulator,
> but no reset pins, so the only way to power-cycle device was to turn
> off/on regulator supply. Then you figure out that you have reset pins
> and it would be useful to add and use it. But already drivers are
> written to power cycle via regulator... or even someone wrote new driver
> regulator-pwrseq to power cycle your device due to missing reset GPIOs...

To add one wrinkle here, board designers have an annoying habit of not
wiring reset pins up so if there is any easy way to support an alternative
(often there is a software reset command over a bus) then keep the reset
pins as optional and implement that in the driver from day one.
Same is true of interrupts, though that can be harder to deal with so
the binding may say they are optional but the driver fail to load without
them.

Nice reply Krzyzstof, I'll try and remember to point people at this one
as the question comes up pretty often.

Thanks,

Jonathan

> 
> 
> Best regards,
> Krzysztof
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ