Skip to content

Commit d92f5de

Browse files
ffainellidavem330
authored andcommitted
net: phy: re-apply PHY fixups during phy_register_device
Commit 87aa9f9 ("net: phy: consolidate PHY reset in phy_init_hw()") moved the call to phy_scan_fixups() in phy_init_hw() after a software reset is performed. By the time phy_init_hw() is called in phy_device_register(), no driver has been bound to this PHY yet, so all the checks in phy_init_hw() against the PHY driver and the PHY driver's config_init function will return 0. We will therefore never call phy_scan_fixups() as we should. Fix this by calling phy_scan_fixups() and check for its return value to restore the intended functionality. This broke PHY drivers which do register an early PHY fixup callback to intercept the PHY probing and do things like changing the 32-bits unique PHY identifier when a pseudo-PHY address has been used, as well as board-specific PHY fixups that need to be applied during driver probe time. Reported-by: Hauke Merthens <[email protected]> Reported-by: Jonas Gorski <[email protected]> Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c472ab6 commit d92f5de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/phy/phy_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ int phy_device_register(struct phy_device *phydev)
355355
phydev->bus->phy_map[phydev->addr] = phydev;
356356

357357
/* Run all of the fixups for this PHY */
358-
err = phy_init_hw(phydev);
358+
err = phy_scan_fixups(phydev);
359359
if (err) {
360360
pr_err("PHY %d failed to initialize\n", phydev->addr);
361361
goto out;

0 commit comments

Comments
 (0)