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: <ZwZUl1jG0bc2q8Le@shell.armlinux.org.uk>
Date: Wed, 9 Oct 2024 11:01:59 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Daniel Golle <daniel@...rotopia.org>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 1/3] net: phy: realtek: read duplex and gbit
 master from PHYSR register

On Wed, Oct 09, 2024 at 02:53:03AM +0100, Daniel Golle wrote:
> -static void rtlgen_decode_speed(struct phy_device *phydev, int val)
> +static void rtlgen_decode_physr(struct phy_device *phydev, int val)
>  {
> -	switch (val & RTLGEN_SPEED_MASK) {
> +	/* bit 2
> +	 * 0: Link not OK
> +	 * 1: Link OK
> +	 */
> +	phydev->link = !!(val & RTL_VND2_PHYSR_LINK);

Be careful with this. The link status bit in the BMSR is latched-low,
meaning that it guarantees to inform the reader that the link failed at
some point between the preceding read and current read.

This is important to know, so code can react to a possibly different
negotiation result (we must see a link-fail to recognise a different
set of negotiation results.)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ