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: <a0a25186fb532668d27243a7743a078fe855d1db.camel@siemens.com>
Date: Fri, 4 Oct 2024 11:42:18 +0000
From: "Sverdlin, Alexander" <alexander.sverdlin@...mens.com>
To: "olteanv@...il.com" <olteanv@...il.com>
CC: "agust@...x.de" <agust@...x.de>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "f.fainelli@...il.com" <f.fainelli@...il.com>,
	"andrew@...n.ch" <andrew@...n.ch>
Subject: Re: [PATCH net v3] net: dsa: lan9303: ensure chip reset and wait for
 READY status

Hi Vladimir!

On Fri, 2024-10-04 at 13:18 +0300, Vladimir Oltean wrote:
> > +	if (read_poll_timeout(lan9303_read, ret,
> > +			      !ret && reg & LAN9303_HW_CFG_READY,
> > +			      20000, 6000000, false,
> > +			      chip->regmap, LAN9303_HW_CFG, &reg)) {
> > +		dev_err(chip->dev, "HW_CFG not ready: 0x%08x\n", reg);
> > +		return -ETIMEDOUT;
> 
> Please:
> 
> 	int ret, err;
> 
> 	err = read_poll_timeout();
> 	if (err)
> 		ret = err;
> 	if (ret) {
> 		dev_err(chip->dev, "failed to read HW_CFG reg: %pe\n",
> 			ERR_PTR(ret));
> 		return ret;
> 	}
> 
> No hardcoding of -ETIMEDOUT either.

I've removed the hardcoded -ETIMEDOUT in the v4, but retained different
error messages, because I believe, individual read errors could be more
informative than generic -ETIMEDOUT, including, maybe even the actual
register value.

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ