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:   Tue, 6 Sep 2022 15:41:23 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Pali Rohár <pali@...nel.org>
Cc:     Shawn Guo <shawn.guo@...aro.org>,
        Lorenzo Pieralisi <lpieralisi@...nel.org>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Rob Herring <robh@...nel.org>,
        Krzysztof Wilczyński <kw@...ux.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] PCI: mvebu: switch to using gpiod API

On Wed, Sep 07, 2022 at 12:09:01AM +0200, Pali Rohár wrote:
> On Tuesday 06 September 2022 14:52:42 Dmitry Torokhov wrote:
> > On Tue, Sep 06, 2022 at 11:41:14PM +0200, Pali Rohár wrote:
> > > On Tuesday 06 September 2022 14:26:32 Dmitry Torokhov wrote:

> > > would not be such easy as during startup we need to reset endpoint card.
> > > Normally just putting it from reset, but if card was not reset state
> > > prior probing driver then it is needed to first put it into reset...
> > > 
> > > I would fix it this issue after your patch is merged to prevent any
> > > other merge conflicts.
> > > 
> > > How to tell devm_fwnode_gpiod_get() function that caller is not
> > > interested in changing signal line? Just by changing GPIOD_OUT_HIGH to 0?
> > 
> > I think there are 2 options:
> > 
> > 1. Start with GPIOD_OUT_LOW (i.e. reset is explicitly deasserted), and
> > then in powerup/powerdown you do explicit on/off transitions with proper
> > timings.
> 
> PERST# is active-low. So deasserting means to put it into high state.
> But device tree can specify if line is active-high as on some board
> designs is GPIO output connected to inverter (or to level shifter with
> additional logic of signal inversion). So what [GPIOD_]OUT_LOW means in
> this context? Just it is needed that from driver point of view always
> value 1 means reset active and 0 means reset inactive, independently of
> double (triple?) inversions.

Think of GPIOD_OUT_LOW and GPIOD_OUT_HIGH as logical off and on, or
logical deactivate/activate. Gpiolib will take into account declared
polarity of the line when it drives the output, so for lines marked as
GPIO_ACTIVE_HIGH GPIO_OUT_HIGH will result in line driven HIGH, whereas
for lines marked as GPIO_ACTIVE_LOW GPIO_OUT_HIGH will result in the
line being driven LOW.

Linus, do you think we should introduce GPIOD_OUT_INACTIVE /
GPIOD_OUT_ACTIVE or GPIOD_OUT_DEASSERTED / GPIOD_OUT_ASSERTED and
deprecate existing GPIOD_OUT_LOW and GPIO_OUT_HIGH?

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ