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: <Z9f5UQPRTPT8lbXm@shell.armlinux.org.uk>
Date: Mon, 17 Mar 2025 10:28:33 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
Cc: Jim Liu <jim.t90615@...il.com>, JJLIU0@...oton.com,
	florian.fainelli@...adcom.com, andrew@...n.ch, hkallweit1@...il.com,
	kuba@...nel.org, edumazet@...gle.com, pabeni@...hat.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] net: phy: broadcom: Correct BCM5221 PHY model
 detection failure

On Mon, Mar 17, 2025 at 09:47:37AM +0100, Michal Swiatkowski wrote:
> It will be nice to have wider explanation what it is fixing in commit
> message. Is phydev->phy_id different than phydev->driver->phy_id? Looks
> like masking isn't crucial as phydev->driver->phy_id is initialized by
> PHY_ID_BCM5221 which is already masked.

The two are very different, and this driver just gets it totally wrong.

phydev->phy_id is the ID read from the PHY. It includes the revision
field.

phydev->drv is one of the phy_driver entries at the bottom of the file.
These contain whatever the driver author puts there, which in this
case would be PHY_ID_BCM5221, and PHY_ID_BCM5221 is defined without
the revision number.

So doing the masking is entirely redundant if you're comparing the
drv->phy_id that was initialised with a definition against the same
definition.

As pointed out in my review with v2, there's more problems in this
driver _because_ this has not been understood. In an attempt to get
rid of some of this stuff, I introduced phydev_id_compare() and
phy_id_compare() helpers into core phylib code, but didn't get
around to updating broadcom.c. See my comments against v2.

-- 
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