diff mbox series

[net] r8169: fix rtl8168h rx crc error

Message ID 20230322064550.2378-1-hau@realtek.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net] r8169: fix rtl8168h rx crc error | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 18 this patch: 18
netdev/cc_maintainers warning 4 maintainers not CCed: kuba@kernel.org edumazet@google.com pabeni@redhat.com davem@davemloft.net
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

ChunHao Lin March 22, 2023, 6:45 a.m. UTC
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.

Signed-off-by: ChunHao Lin <hau@realtek.com>
---
 drivers/net/ethernet/realtek/r8169_phy_config.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Horatiu Vultur March 22, 2023, 8:21 a.m. UTC | #1
The 03/22/2023 14:45, ChunHao Lin wrote:
> 
> 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.

Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>

> 
> Signed-off-by: ChunHao Lin <hau@realtek.com>
> ---
>  drivers/net/ethernet/realtek/r8169_phy_config.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/realtek/r8169_phy_config.c b/drivers/net/ethernet/realtek/r8169_phy_config.c
> index 930496cd34ed..b50f16786c24 100644
> --- a/drivers/net/ethernet/realtek/r8169_phy_config.c
> +++ b/drivers/net/ethernet/realtek/r8169_phy_config.c
> @@ -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
>
ChunHao Lin March 22, 2023, 12:13 p.m. UTC | #2
> The 03/22/2023 14:45, ChunHao Lin wrote:
> >
> > 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.

> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> 
> >
> > Signed-off-by: ChunHao Lin <hau@realtek.com>
> > ---
> >  drivers/net/ethernet/realtek/r8169_phy_config.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/realtek/r8169_phy_config.c
> > b/drivers/net/ethernet/realtek/r8169_phy_config.c
> > index 930496cd34ed..b50f16786c24 100644
> > --- a/drivers/net/ethernet/realtek/r8169_phy_config.c
> > +++ b/drivers/net/ethernet/realtek/r8169_phy_config.c
> > @@ -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
> >
> 
> --
> /Horatiu
> 
> ------Please consider the environment before printing this e-mail.
Jakub Kicinski March 22, 2023, 7:59 p.m. UTC | #3
On Wed, 22 Mar 2023 12:13:12 +0000 Hau wrote:
> > 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.
ChunHao Lin March 23, 2023, 1:57 p.m. UTC | #4
> On Wed, 22 Mar 2023 12:13:12 +0000 Hau wrote:
> > > 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.
> 
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.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/realtek/r8169_phy_config.c b/drivers/net/ethernet/realtek/r8169_phy_config.c
index 930496cd34ed..b50f16786c24 100644
--- a/drivers/net/ethernet/realtek/r8169_phy_config.c
+++ b/drivers/net/ethernet/realtek/r8169_phy_config.c
@@ -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);
 }