Skip to content

Commit a141af8

Browse files
oleremkuba-moo
authored andcommitted
net: phy: smsc: Fix Auto-MDIX configuration when disabled by strap
Correct the Auto-MDIX configuration to ensure userspace settings are respected when the feature is disabled by the AUTOMDIX_EN hardware strap. The LAN9500 PHY allows its default MDI-X mode to be configured via a hardware strap. If this strap sets the default to "MDI-X off", the driver was previously unable to enable Auto-MDIX from userspace. When handling the ETH_TP_MDI_AUTO case, the driver would set the SPECIAL_CTRL_STS_AMDIX_ENABLE_ bit but neglected to set the required SPECIAL_CTRL_STS_OVRRD_AMDIX_ bit. Without the override flag, the PHY falls back to its hardware strap default, ignoring the software request. This patch corrects the behavior by also setting the override bit when enabling Auto-MDIX. This ensures that the userspace configuration takes precedence over the hardware strap, allowing Auto-MDIX to be enabled correctly in all scenarios. Fixes: 05b35e7 ("smsc95xx: add phylib support") Signed-off-by: Oleksij Rempel <[email protected]> Cc: Andre Edich <[email protected]> Reviewed-by: Maxime Chevallier <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 78b7920 commit a141af8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/phy/smsc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ static int lan87xx_config_aneg(struct phy_device *phydev)
167167
SPECIAL_CTRL_STS_AMDIX_STATE_;
168168
break;
169169
case ETH_TP_MDI_AUTO:
170-
val = SPECIAL_CTRL_STS_AMDIX_ENABLE_;
170+
val = SPECIAL_CTRL_STS_OVRRD_AMDIX_ |
171+
SPECIAL_CTRL_STS_AMDIX_ENABLE_;
171172
break;
172173
default:
173174
return genphy_config_aneg(phydev);

0 commit comments

Comments
 (0)