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: <87743158-f65e-53cc-dd09-1720d6e6e0b9@ncr.com>
Date:   Tue, 31 Jan 2023 10:25:04 +0000
From:   "Leonard, Niall" <Niall.Leonard@....com>
To:     Rob Herring <robh@...nel.org>,
        "Leonard, Niall" <Niall.Leonard@....com>
CC:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] gpio: dt-bindings: add new property to wd,mbl-gpio
 bindings

On 30/01/2023 18:37, Rob Herring wrote:
> *External Message* - Use caution before opening links or attachments
> 
> On Mon, Jan 30, 2023 at 01:20:55PM +0000, Leonard, Niall wrote:
>> On 29/01/2023 15:59, Krzysztof Kozlowski wrote:
>>> *External Message* - Use caution before opening links or attachments
>>>
>>> On 27/01/2023 12:39, Leonard, Niall wrote:
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
>>>>> Sent: 26 January 2023 12:29
>>>>> To: Leonard, Niall <Niall.Leonard@....com>; Linus Walleij
>>>>> <linus.walleij@...aro.org>; Bartosz Golaszewski <brgl@...ev.pl>; Rob
>>>>> Herring <robh+dt@...nel.org>; Krzysztof Kozlowski
>>>>> <krzysztof.kozlowski+dt@...aro.org>
>>>>> Cc: linux-gpio@...r.kernel.org; devicetree@...r.kernel.org; linux-
>>>>> kernel@...r.kernel.org
>>>>> Subject: Re: [PATCH 1/3] gpio: dt-bindings: add new property to wd,mbl-gpio
>>>>> bindings
>>>>>
>>>>> *External Message* - Use caution before opening links or attachments
>>>>>
>>>>> On 26/01/2023 11:17, Niall Leonard via B4 Submission Endpoint wrote:
>>>>>> From: Niall Leonard <nl250060@....com>
>>>>>
>>>>> Subject: missing "wd,mbl-gpio:" prefix.
>>>>>
>>>>> Subject: drop second/last, redundant "bindings". The "dt-bindings"
>>>>> prefix is already stating that these are bindings.
>>>>>
>>>>>>
>>>>>> Added optional "no-input" property
>>>>>
>>>>> Missing full stop.
>>>>>
>>>>>>
>>>>>> Signed-off-by: Niall Leonard <nl250060@....com>
>>>>>> ---
>>>>>>    Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt | 1 +
>>>>>>    1 file changed, 1 insertion(+)
>>>>>>
>>>>>> diff --git a/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt
>>>>>> b/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt
>>>>>> index 038c3a6a1f4d..9405f9dad522 100644
>>>>>> --- a/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt
>>>>>> +++ b/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt
>>>>>> @@ -18,6 +18,7 @@ Required properties:
>>>>>>
>>>>>>    Optional properties:
>>>>>>    	- no-output: GPIOs are read-only.
>>>>>> +	- no-input: GPIOs are write-only. Read is via a shadow register.
>>>>>
>>>>> Why this property is needed? Why driver cannot always use shadow
>>>>> register?
>>>>>
>>>> The shadow register is currently only used during the write operation. It is not available during the read operation.
>>>
>>> You just wrote above that reading is via shadow register, so how can it
>>> not be available for reads? Again, why you cannot always read via shadow
>>> register and need to make a property? You mean that for other GPIOs
>>> there is no shadow register at all?
>>>
>> The existing read method does not use the shadow register.
>>
>> static int bgpio_get(struct gpio_chip *gc, unsigned int gpio)
>> {
>> 	return !!(gc->read_reg(gc->reg_dat) & bgpio_line2mask(gc, gpio));
>> }
>>
>>> What changes between one board and another that justifies this property?
>>
>> I have a couple of boards where the electronics engineer decided to only
>> use the chip select line, so no read/write signal is connected. This
>> means that reading the address activates the chip select and drives the
>> contents of the data bus to the port.
> 
> This part makes sense as you explained the h/w.
> 
>> For example is someone reads the
>> file /sys/kernel/debug/gpio this corrupts the port. So I have had to add
>> this property to avoid that situation.
> 
> Not quite relevant to the DT binding being a Linux detail.
> 
>>
>> If you are strongly against this then just reject it and I will look
>> after it myself. I thought there may be others who would find this
>> change useful.
> 
> A property for a board level quirk is appropriate. You just need to
> explain that in the commit message rather than stating what the diff
> already tells us.
> 
> Rob
Thanks for reviewing.
I will update the description in the patch introduction to indicate this 
a board level quirk and the reasoning behind it.

Regards,
Niall Leonard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ