Skip to content

Commit 38278ac

Browse files
author
Izabela Bakollari
committed
net: phy: realtek: Fix MMD access on RTL8126A-integrated PHY
JIRA: https://issues.redhat.com/browse/RHEL-57766 commit a6ad589 Author: Heiner Kallweit <hkallweit1@gmail.com> Date: Mon Oct 7 11:57:41 2024 +0200 net: phy: realtek: Fix MMD access on RTL8126A-integrated PHY All MMD reads return 0 for the RTL8126A-integrated PHY. Therefore phylib assumes it doesn't support EEE, what results in higher power consumption, and a significantly higher chip temperature in my case. To fix this split out the PHY driver for the RTL8126A-integrated PHY and set the read_mmd/write_mmd callbacks to read from vendor-specific registers. Fixes: 5befa37 ("net: phy: realtek: add support for RTL8126A-integrated 5Gbps PHY") Cc: stable@vger.kernel.org Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
1 parent f93fc00 commit 38278ac

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

drivers/net/phy/realtek.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,16 @@ static int rtl8221b_vn_cg_c45_match_phy_device(struct phy_device *phydev)
10811081
return rtlgen_is_c45_match(phydev, RTL_8221B_VN_CG, true);
10821082
}
10831083

1084+
static int rtl8251b_c22_match_phy_device(struct phy_device *phydev)
1085+
{
1086+
return rtlgen_is_c45_match(phydev, RTL_8251B, false);
1087+
}
1088+
1089+
static int rtl8251b_c45_match_phy_device(struct phy_device *phydev)
1090+
{
1091+
return rtlgen_is_c45_match(phydev, RTL_8251B, true);
1092+
}
1093+
10841094
static int rtlgen_resume(struct phy_device *phydev)
10851095
{
10861096
int ret = genphy_resume(phydev);
@@ -1418,7 +1428,7 @@ static struct phy_driver realtek_drvs[] = {
14181428
.suspend = genphy_c45_pma_suspend,
14191429
.resume = rtlgen_c45_resume,
14201430
}, {
1421-
PHY_ID_MATCH_EXACT(0x001cc862),
1431+
.match_phy_device = rtl8251b_c45_match_phy_device,
14221432
.name = "RTL8251B 5Gbps PHY",
14231433
.get_features = rtl822x_get_features,
14241434
.config_aneg = rtl822x_config_aneg,
@@ -1427,6 +1437,18 @@ static struct phy_driver realtek_drvs[] = {
14271437
.resume = rtlgen_resume,
14281438
.read_page = rtl821x_read_page,
14291439
.write_page = rtl821x_write_page,
1440+
}, {
1441+
.match_phy_device = rtl8251b_c22_match_phy_device,
1442+
.name = "RTL8126A-internal 5Gbps PHY",
1443+
.get_features = rtl822x_get_features,
1444+
.config_aneg = rtl822x_config_aneg,
1445+
.read_status = rtl822x_read_status,
1446+
.suspend = genphy_suspend,
1447+
.resume = rtlgen_resume,
1448+
.read_page = rtl821x_read_page,
1449+
.write_page = rtl821x_write_page,
1450+
.read_mmd = rtl822x_read_mmd,
1451+
.write_mmd = rtl822x_write_mmd,
14301452
}, {
14311453
PHY_ID_MATCH_EXACT(0x001ccad0),
14321454
.name = "RTL8224 2.5Gbps PHY",

0 commit comments

Comments
 (0)