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:
 <AS8PR04MB8676BD0B2C6BB61EA28D59E08CE42@AS8PR04MB8676.eurprd04.prod.outlook.com>
Date: Tue, 7 May 2024 07:53:55 +0000
From: Hongxing Zhu <hongxing.zhu@....com>
To: Linus Walleij <linus.walleij@...aro.org>, Andy Shevchenko
	<andriy.shevchenko@...ux.intel.com>
CC: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>, Frank Li
	<frank.li@....com>, Krzysztof Wilczyński
	<kwilczynski@...nel.org>, Uwe Kleine-König
	<u.kleine-koenig@...gutronix.de>, "linux-omap@...r.kernel.org"
	<linux-omap@...r.kernel.org>, "linux-pci@...r.kernel.org"
	<linux-pci@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	"linux-amlogic@...ts.infradead.org" <linux-amlogic@...ts.infradead.org>,
	"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
	"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>, Vignesh
 Raghavendra <vigneshr@...com>, Siddharth Vadapalli <s-vadapalli@...com>,
	Lorenzo Pieralisi <lpieralisi@...nel.org>,
	Krzysztof Wilczyński <kw@...ux.com>, Rob Herring
	<robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>, Lucas Stach
	<l.stach@...gutronix.de>, Shawn Guo <shawnguo@...nel.org>, Sascha Hauer
	<s.hauer@...gutronix.de>, Pengutronix Kernel Team <kernel@...gutronix.de>,
	Fabio Estevam <festevam@...il.com>, Yue Wang <yue.wang@...ogic.com>, Neil
 Armstrong <neil.armstrong@...aro.org>, Kevin Hilman <khilman@...libre.com>,
	Jerome Brunet <jbrunet@...libre.com>, Martin Blumenstingl
	<martin.blumenstingl@...glemail.com>, Xiaowei Song
	<songxiaowei@...ilicon.com>, Binghui Wang <wangbinghui@...ilicon.com>,
	Thierry Reding <thierry.reding@...il.com>, Jonathan Hunter
	<jonathanh@...dia.com>, Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
	Pali Rohár <pali@...nel.org>
Subject: RE: [PATCH v3 4/5] PCI: imx6: Convert to agnostic GPIO API

> -----Original Message-----
> From: Linus Walleij <linus.walleij@...aro.org>
> Sent: 2024年5月6日 20:10
> To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Cc: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>; Frank Li
> <frank.li@....com>; Krzysztof Wilczyński <kwilczynski@...nel.org>; Uwe
> Kleine-König <u.kleine-koenig@...gutronix.de>; linux-omap@...r.kernel.org;
> linux-pci@...r.kernel.org; linux-arm-kernel@...ts.infradead.org;
> linux-kernel@...r.kernel.org; imx@...ts.linux.dev;
> linux-amlogic@...ts.infradead.org; linux-arm-msm@...r.kernel.org;
> linux-tegra@...r.kernel.org; Vignesh Raghavendra <vigneshr@...com>;
> Siddharth Vadapalli <s-vadapalli@...com>; Lorenzo Pieralisi
> <lpieralisi@...nel.org>; Krzysztof Wilczyński <kw@...ux.com>; Rob Herring
> <robh@...nel.org>; Bjorn Helgaas <bhelgaas@...gle.com>; Hongxing Zhu
> <hongxing.zhu@....com>; Lucas Stach <l.stach@...gutronix.de>; Shawn Guo
> <shawnguo@...nel.org>; Sascha Hauer <s.hauer@...gutronix.de>; Pengutronix
> Kernel Team <kernel@...gutronix.de>; Fabio Estevam <festevam@...il.com>;
> Yue Wang <yue.wang@...ogic.com>; Neil Armstrong
> <neil.armstrong@...aro.org>; Kevin Hilman <khilman@...libre.com>; Jerome
> Brunet <jbrunet@...libre.com>; Martin Blumenstingl
> <martin.blumenstingl@...glemail.com>; Xiaowei Song
> <songxiaowei@...ilicon.com>; Binghui Wang <wangbinghui@...ilicon.com>;
> Thierry Reding <thierry.reding@...il.com>; Jonathan Hunter
> <jonathanh@...dia.com>; Thomas Petazzoni <thomas.petazzoni@...tlin.com>;
> Pali Rohár <pali@...nel.org>
> Subject: Re: [PATCH v3 4/5] PCI: imx6: Convert to agnostic GPIO API
> 
> On Mon, Apr 29, 2024 at 12:25 PM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
> 
> > The of_gpio.h is going to be removed. In preparation of that convert
> > the driver to the agnostic API.
> >
> > Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> > Reviewed-by: Frank Li <Frank.Li@....com>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> 
> I think there is a bug here, the code is respecting the OF property
> "reset-gpio-active-high"
Yes, you're right.
As I remember that this property is used for the buggy hardware design.
In general implementation, the PERST# is active low.
In pci_imx6 driver, it used to call the following callbacks to toggle perst#
 gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0);
 msleep(100);
 gpio_set_value_cansleep(imx6_pcie->reset_gpio, 1);

But, some buggy hardware designs use this GPIO signal active high.
And the correct toggle sequence for thos board is reversed.
 gpio_set_value_cansleep(imx6_pcie->reset_gpio, 1);
 msleep(100);
 gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0);

So, this property is added for those buggy hardware designs.

Best Regards
Richard Zhu
> but the code in drivers/gpio/gpiolib-of.h actually has a quirk for this so you can
> just delete all the active high handling and rely on 1 = asserted and 0 = deasserted
> when using GPIO descriptors.
> 
> Just delete this thing:
> imx6_pcie->gpio_active_high = of_property_read_bool(node,
>                                            "reset-gpio-active-high");
> 
> Yours,
> Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ