Commit 081156ce authored by Daniel Golle's avatar Daniel Golle Committed by Paolo Abeni
Browse files

net: phy: mxl-gpy: fix link properties on USXGMII and internal PHYs



gpy_update_interface() returns early in case the PHY is internal or
connected via USXGMII. In this case the gigabit master/slave property
as well as MDI/MDI-X status also won't be read which seems wrong.
Always read those properties by moving the logic to retrieve them to
gpy_read_status().

Fixes: fd8825cd ("net: phy: mxl-gpy: Add PHY Auto/MDI/MDI-X set driver for GPY211 chips")
Fixes: 311abcdd ("net: phy: add support to get Master-Slave configuration")
Suggested-by: default avatar"Russell King (Oracle)" <linux@armlinux.org.uk>
Signed-off-by: default avatarDaniel Golle <daniel@makrotopia.org>
Link: https://patch.msgid.link/71fccf3f56742116eb18cc070d2a9810479ea7f9.1763650701.git.daniel@makrotopia.org


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 82fca3d8
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -578,13 +578,7 @@ static int gpy_update_interface(struct phy_device *phydev)
		break;
	}

	if (phydev->speed == SPEED_2500 || phydev->speed == SPEED_1000) {
		ret = genphy_read_master_slave(phydev);
		if (ret < 0)
			return ret;
	}

	return gpy_update_mdix(phydev);
	return 0;
}

static int gpy_read_status(struct phy_device *phydev)
@@ -639,6 +633,16 @@ static int gpy_read_status(struct phy_device *phydev)
		ret = gpy_update_interface(phydev);
		if (ret < 0)
			return ret;

		if (phydev->speed == SPEED_2500 || phydev->speed == SPEED_1000) {
			ret = genphy_read_master_slave(phydev);
			if (ret < 0)
				return ret;
		}

		ret = gpy_update_mdix(phydev);
		if (ret < 0)
			return ret;
	}

	return 0;