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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87sfvncl59.wl-maz@kernel.org>
Date:   Tue, 23 Nov 2021 08:48:50 +0000
From:   Marc Zyngier <maz@...nel.org>
To:     Luca Ceresoli <luca@...aceresoli.net>
Cc:     Pali Rohár <pali@...nel.org>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-pci@...r.kernel.org, kernel-team@...roid.com,
        Alyssa Rosenzweig <alyssa@...enzweig.io>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH v2] PCI: apple: Follow the PCIe specifications when resetting the port

Luca,

On Mon, 22 Nov 2021 21:32:15 +0000,
Luca Ceresoli <luca@...aceresoli.net> wrote:
>
> >> Just one comment. PERST# (PCIe Reset) is active-low signal. De-asserting
> >> means to really set value to 1.
> >>
> >> But there was a discussion that de-asserting should be done by call:
> >>   gpiod_set_value(reset, 0);
> >>
> >> https://lore.kernel.org/linux-pci/51be082a-ff10-8a19-5648-f279aabcac51@lucaceresoli.net/
> >>
> >> Could we make this new pcie-apple.c driver to use gpiod_set_value(reset, 0)
> >> for de-asserting, like in other drivers?
> 
> I agree it should be done right from the beginning since this is a new
> driver. Fixing it later is a painful process.

No more painful than anything else. At this stage, using a positive or
negative polarity is immaterial, as there is no core infrastructure
making any use of this behaviour (every single driver must reinvent
its own square wheel). If such an infrastructure existed, that'd
indeed be a requirement. For now, this is merely a convention.

> > I guess it depends whether you care about the assertion or the signal
> > itself. I think we may have a bug in the way the GPIOs are handled at
> > the moment, as it makes no difference whether I register the GPIO are
> > active high or active low...
> >
> > I guess that will be yet another thing to debug, but in the meantime
> > we have a reliable reset.
> 
> Strange, in my case the "active low" pin polarity is correctly picked up
> from device tree by the gpiolib code, thus using gpio_set_value(gpiod,
> 1) asserts the pin as it should, resulting in an electrically low pin.

As I said, this looks like a bug, probably in the M1 DT. I'll try to
look into it when I get the time.

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ