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:11:06 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Ioana Ciornei <ioana.ciornei@....com>
Cc:     davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, netdev@...r.kernel.org, hkallweit1@...il.com,
        linux@...linux.org.uk, f.fainelli@...il.com
Subject: Re: [PATCH v2 net] net: phy: aquantia: wait for the suspend/resume
 operations to finish

> +static int aqr107_wait_processor_intensive_op(struct phy_device *phydev)
> +{
> +	int val, err;
> +
> +	/* The datasheet notes to wait at least 1ms after issuing a
> +	 * processor intensive operation before checking.
> +	 * We cannot use the 'sleep_before_read' parameter of read_poll_timeout
> +	 * because that just determines the maximum time slept, not the minimum.
> +	 */
> +	usleep_range(1000, 5000);
> +
> +	err = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1,
> +					VEND1_GLOBAL_GEN_STAT2, val,
> +					!(val & VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG),
> +					AQR107_OP_IN_PROG_SLEEP,
> +					AQR107_OP_IN_PROG_TIMEOUT, false);
> +	if (err) {
> +		phydev_err(phydev, "timeout: processor-intensive MDIO operation\n");
> +		return err;
> +	}
> +
> +	return 0;

nitpick: You could simplify this to:

> +	if (err)
> +		phydev_err(phydev, "timeout: processor-intensive MDIO operation\n");
> +
> +	return err;
> +}

Reviewed-by: Andrew Lunn <andrew@...n.ch>

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ