Skip to content

Commit bfc17c1

Browse files
Russell King (Oracle)Paolo Abeni
Russell King (Oracle)
authored and
Paolo Abeni
committed
net: phy: realtek: disable PHY-mode EEE
Realtek RTL8211F has a "PHY-mode" EEE support which interferes with an IEEE 802.3 compliant implementation. This mode defaults to enabled, and results in the MAC receive path not seeing the link transition to LPI state. Fix this by disabling PHY-mode EEE. Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 4b9235a commit bfc17c1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/net/phy/realtek/realtek_main.c

+9-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434
#define RTL8211F_PHYCR1 0x18
3535
#define RTL8211F_PHYCR2 0x19
36+
#define RTL8211F_CLKOUT_EN BIT(0)
37+
#define RTL8211F_PHYCR2_PHY_EEE_ENABLE BIT(5)
38+
3639
#define RTL8211F_INSR 0x1d
3740

3841
#define RTL8211F_LEDCR 0x10
@@ -55,8 +58,6 @@
5558
#define RTL8211E_TX_DELAY BIT(12)
5659
#define RTL8211E_RX_DELAY BIT(11)
5760

58-
#define RTL8211F_CLKOUT_EN BIT(0)
59-
6061
#define RTL8201F_ISR 0x1e
6162
#define RTL8201F_ISR_ANERR BIT(15)
6263
#define RTL8201F_ISR_DUPLEX BIT(13)
@@ -453,6 +454,12 @@ static int rtl8211f_config_init(struct phy_device *phydev)
453454
str_enabled_disabled(val_rxdly));
454455
}
455456

457+
/* Disable PHY-mode EEE so LPI is passed to the MAC */
458+
ret = phy_modify_paged(phydev, 0xa43, RTL8211F_PHYCR2,
459+
RTL8211F_PHYCR2_PHY_EEE_ENABLE, 0);
460+
if (ret)
461+
return ret;
462+
456463
if (priv->has_phycr2) {
457464
ret = phy_modify_paged(phydev, 0xa43, RTL8211F_PHYCR2,
458465
RTL8211F_CLKOUT_EN, priv->phycr2);

0 commit comments

Comments
 (0)