Skip to content

Commit 676ec53

Browse files
RajuRangojuPaolo Abeni
authored andcommitted
amd-xgbe: handle corner-case during sfp hotplug
Force the mode change for SFI in Fixed PHY configurations. Fixed PHY configurations needs PLL to be enabled while doing mode set. When the SFP module isn't connected during boot, driver assumes AN is ON and attempts auto-negotiation. However, if the connected SFP comes up in Fixed PHY configuration the link will not come up as PLL isn't enabled while the initial mode set command is issued. So, force the mode change for SFI in Fixed PHY configuration to fix link issues. Fixes: e57f7a3 ("amd-xgbe: Prepare for working with more than one type of phy") Acked-by: Shyam Sundar S K <[email protected]> Signed-off-by: Raju Rangoju <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 818ad9c commit 676ec53

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-mdio.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,19 @@ static int xgbe_phy_config_fixed(struct xgbe_prv_data *pdata)
11931193
if (pdata->phy.duplex != DUPLEX_FULL)
11941194
return -EINVAL;
11951195

1196-
xgbe_set_mode(pdata, mode);
1196+
/* Force the mode change for SFI in Fixed PHY config.
1197+
* Fixed PHY configs needs PLL to be enabled while doing mode set.
1198+
* When the SFP module isn't connected during boot, driver assumes
1199+
* AN is ON and attempts autonegotiation. However, if the connected
1200+
* SFP comes up in Fixed PHY config, the link will not come up as
1201+
* PLL isn't enabled while the initial mode set command is issued.
1202+
* So, force the mode change for SFI in Fixed PHY configuration to
1203+
* fix link issues.
1204+
*/
1205+
if (mode == XGBE_MODE_SFI)
1206+
xgbe_change_mode(pdata, mode);
1207+
else
1208+
xgbe_set_mode(pdata, mode);
11971209

11981210
return 0;
11991211
}

0 commit comments

Comments
 (0)