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]
Date: Mon, 26 Feb 2024 18:05:16 +0100
From: Thomas Richard <thomas.richard@...tlin.com>
To: Andy Shevchenko <andy@...nel.org>
Cc: Linus Walleij <linus.walleij@...aro.org>,
 Bartosz Golaszewski <brgl@...ev.pl>, Tony Lindgren <tony@...mide.com>,
 Haojian Zhuang <haojian.zhuang@...aro.org>, Vignesh R <vigneshr@...com>,
 Aaro Koskinen <aaro.koskinen@....fi>,
 Janusz Krzysztofik <jmkrzyszt@...il.com>, Andi Shyti
 <andi.shyti@...nel.org>, Peter Rosin <peda@...ntia.se>,
 Vinod Koul <vkoul@...nel.org>, Kishon Vijay Abraham I <kishon@...nel.org>,
 Philipp Zabel <p.zabel@...gutronix.de>,
 Lorenzo Pieralisi <lpieralisi@...nel.org>,
 Krzysztof Wilczyński <kw@...ux.com>,
 Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
 linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-omap@...r.kernel.org,
 linux-i2c@...r.kernel.org, linux-phy@...ts.infradead.org,
 linux-pci@...r.kernel.org, gregory.clement@...tlin.com,
 theo.lebrun@...tlin.com, thomas.petazzoni@...tlin.com, u-kumar1@...com
Subject: Re: [PATCH v3 17/18] PCI: j721e: add reset GPIO to struct j721e_pcie

On 2/15/24 17:04, Andy Shevchenko wrote:
> On Thu, Feb 15, 2024 at 04:18:02PM +0100, Thomas Richard wrote:
>> From: Théo Lebrun <theo.lebrun@...tlin.com>
>>
>> Add reset GPIO to struct j721e_pcie, so it can be used at suspend and
>> resume stages.
> 
> ...
> 
>>  	case PCI_MODE_RC:
>> -		gpiod = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
>> -		if (IS_ERR(gpiod)) {
>> -			ret = PTR_ERR(gpiod);
>> +		pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
>> +		if (IS_ERR(pcie->reset_gpio)) {
>> +			ret = PTR_ERR(pcie->reset_gpio);
>>  			if (ret != -EPROBE_DEFER)
>>  				dev_err(dev, "Failed to get reset GPIO\n");
>>  			goto err_get_sync;
>> @@ -504,9 +504,9 @@ static int j721e_pcie_probe(struct platform_device *pdev)
>>  		 * mode is selected while enabling the PHY. So deassert PERST#
>>  		 * after 100 us.
>>  		 */
>> -		if (gpiod) {
>> +		if (pcie->reset_gpio) {
>>  			usleep_range(100, 200);
>> -			gpiod_set_value_cansleep(gpiod, 1);
>> +			gpiod_set_value_cansleep(pcie->reset_gpio, 1);
>>  		}
> 
> Instead of all this, just add one line assignment. Moreover, before or after
> this patch refactor the code to use ret = dev_err_probe(...); pattern that
> eliminates those deferral probe checks.

Hi Andy,

I'm not sure what you exactly want when you write "just add one line
assignment".
For the dev_err_probe() it's okay, it will be fixed in the next iteration.

Regards,

-- 
Thomas Richard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ