r8169: fix rtl8168h rx crc error
PATCH 1/1 r8169: fix rtl8168h rx crc error
When link speed is 10 Mbps and temperature is under -20°C, rtl8168h may have rx crc error. Disable phy 10 Mbps pll off to fix this issue.
--- drivers/net/ethernet/realtek/r8169_phy_config.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/realtek/r8169_phy_config.c +3 -0
@@ -826,6 +826,9 @@ static void rtl8168h_2_hw_phy_config(struct rtl8169_private *tp,/* disable phy pfm mode */ phy_modify_paged (phydev,0x0a44 ,0x11 ,BIT (7 ),0 ); +/* disable 10m pll off */ +phy_modify_paged (phydev,0x0a43 ,0x10 ,BIT (0 ),0 ); +rtl8168g_disable_aldps (phydev);rtl8168g_config_eee_phy (phydev); }
Signature · 1 line
2.37.2
Quoted 3 lines · ChunHao Lin
When link speed is 10 Mbps and temperature is under -20°C, rtl8168h may have rx crc error. Disable phy 10 Mbps pll off to fix this issue.
Don't forget to add the fixes tag.
Another comment that I usually get is to replace hardcoded values with defines, but on the other side I can see that this file already has plently of hardcoded values.
Quoted 23 lines
Signed-off-by ChunHao Lin <[email protected]>--- drivers/net/ethernet/realtek/r8169_phy_config.c | 3 +++ 1 file changed, 3 insertions(+)drivers/net/ethernet/realtek/r8169_phy_config.c +3
-1@@ -826,6 +826,9 @@ static void rtl8168h_2_hw_phy_config(struct rtl8169_private *tp,/* disable phy pfm mode */ phy_modify_paged (phydev,0x0a44 ,0x11 ,BIT (7 ),0 ); +/* disable 10m pll off */ +phy_modify_paged (phydev,0x0a43 ,0x10 ,BIT (0 ),0 ); +rtl8168g_disable_aldps (phydev);rtl8168g_config_eee_phy (phydev); } --2.37.2
Signature · 1 line
/Horatiu
Quoted 10 lines
Quoted 3 lines · ChunHao Lin
When link speed is 10 Mbps and temperature is under -20°C, rtl8168h may have rx crc error. Disable phy 10 Mbps pll off to fix this issue.
Don't forget to add the fixes tag.
Another comment that I usually get is to replace hardcoded values with defines, but on the other side I can see that this file already has plently of hardcoded values.
It is not a fix for a specific commit. PHY 10m pll off is an power saving feature which is enabled by H/W default. This issue can be fixed by disable PHY 10m pll off.
Quoted 31 lines
Reviewed-by Horatiu Vultur <[email protected]>drivers/net/ethernet/realtek/r8169_phy_config.c static void rtl8168h_2_hw_phy_config(struct
Quoted 12 lines
Signed-off-by ChunHao Lin <[email protected]>--- drivers/net/ethernet/realtek/r8169_phy_config.c | 3 +++ 1 file changed, 3 insertions(+)drivers/net/ethernet/realtek/r8169_phy_config.c +0
-0@@ -826,6 +826,9 @@ static void rtl8168h_2_hw_phy_config(struct
rtl8169_private*tp,Quoted 11 lines
drivers/net/ethernet/realtek/r8169_phy_config.c +3
-1/* disable phy pfm mode */ phy_modify_paged (phydev,0x0a44 ,0x11 ,BIT (7 ),0 ); +/* disable 10m pll off */ +phy_modify_paged (phydev,0x0a43 ,0x10 ,BIT (0 ),0 ); +rtl8168g_disable_aldps (phydev);rtl8168g_config_eee_phy (phydev); } --2.37.2
--
/Horatiu------Please consider the environment before printing this e-mail.
Jakub Kicinski
maintainerQuoted 8 lines · On Wed, 22 Mar 2023 12:13:12 +0000 Hau wrote:
Quoted 4 lines
Don't forget to add the fixes tag.
Another comment that I usually get is to replace hardcoded values with defines, but on the other side I can see that this file already has plently of hardcoded values.It is not a fix for a specific commit. PHY 10m pll off is an power saving feature which is enabled by H/W default. This issue can be fixed by disable PHY 10m pll off.
How far back can the issue be reproduced? Is it only possible with certain device types? Then the Fixes tag should point at the commit which added support for the devices. Was it always present since 2.6 kernels? Put the first commit in the git history as Fixes.
Quoted 6 lines · On Wed, 22 Mar 2023 12:13:12 +0000 Hau wrote:
Quoted 5 lines
Quoted 4 lines
Don't forget to add the fixes tag.
Another comment that I usually get is to replace hardcoded values with defines, but on the other side I can see that this file already has plently of hardcoded values.
Quoted 9 lines
Quoted 3 lines
It is not a fix for a specific commit. PHY 10m pll off is an power saving feature which is enabled by H/W default. This issue can be fixed by disable PHY 10m pll off.
How far back can the issue be reproduced? Is it only possible with certain device types? Then the Fixes tag should point at the commit which added support for the devices. Was it always present since 2.6 kernels? Put the first commit in the git history as Fixes.
RTL8168H is the only chip we know that has this issue. This issue is related to the H/W default setting. So I will add a Fixes tag to the commit which added support for this chip and submit the patch again.
------Please consider the environment before printing this e-mail.