From cec663aa8dc5311239f3925a1333fc1ed9066eba Mon Sep 17 00:00:00 2001 From: Sushil Kumar Singh Date: Wed, 19 Jul 2023 13:01:38 +0530 Subject: [PATCH] r8168: Fix -20C 10mbps failure in Mods test Issue: Ethernet mplan stability tests at -20C for 10Mbps fails with rate 15% Basically the GPHY 10M power saving includes the below parameters, clock speed down, pll off and reference voltage off. During debugging it was found that enable/disable pll circuit frequently when in 10M low data traffic (such as idle mode) may have a corner case and plays a part in this issue repro. Fix: So plloff saving function should be disable (do not have to open it) for nvidia -20C mplan test case. Bug 3946623 Change-Id: I87ab9b487fe5924ee9ee16bbb14d7f8c19f3a4e7 Signed-off-by: Sushil Kumar Singh Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2939046 Tested-by: Revanth Kumar Uppala Reviewed-by: Revanth Kumar Uppala Reviewed-by: Bitan Biswas GVS: Gerrit_Virtual_Submit Signed-off-by: Revanth Kumar Uppala (cherry picked from commit 80f6470d40821bfbad8f8166d22442e949b47173) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2942039 Reviewed-by: Laxman Dewangan --- drivers/net/ethernet/realtek/r8168_n.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168_n.c b/drivers/net/ethernet/realtek/r8168_n.c index 7e9e2eac..ff7b60a9 100644 --- a/drivers/net/ethernet/realtek/r8168_n.c +++ b/drivers/net/ethernet/realtek/r8168_n.c @@ -24195,7 +24195,10 @@ rtl8168_hw_phy_config(struct net_device *dev) } rtl8168_mdio_write(tp, 0x1F, 0x0A44); - rtl8168_set_eth_phy_bit( tp, 0x11, BIT_11 ); + rtl8168_clear_eth_phy_bit(tp, 0x11, (BIT_11 | BIT_7)); + rtl8168_set_eth_phy_bit(tp, 0x11, (BIT_11)); + rtl8168_mdio_write(tp, 0x1F, 0x0A43); + rtl8168_clear_eth_phy_bit(tp, 0x10, (BIT_0)); rtl8168_mdio_write(tp, 0x1F, 0x0000); @@ -24248,7 +24251,10 @@ rtl8168_hw_phy_config(struct net_device *dev) } rtl8168_mdio_write(tp, 0x1F, 0x0A44); - rtl8168_set_eth_phy_bit( tp, 0x11, BIT_11 ); + rtl8168_clear_eth_phy_bit(tp, 0x11, (BIT_11 | BIT_7)); + rtl8168_set_eth_phy_bit(tp, 0x11, (BIT_11)); + rtl8168_mdio_write(tp, 0x1F, 0x0A43); + rtl8168_clear_eth_phy_bit(tp, 0x10, (BIT_0)); rtl8168_mdio_write(tp, 0x1F, 0x0000); if (tp->RequireAdcBiasPatch) { @@ -24463,7 +24469,10 @@ rtl8168_hw_phy_config(struct net_device *dev) } } else if (tp->mcfg == CFG_METHOD_35) { rtl8168_mdio_write(tp, 0x1F, 0x0A44); - rtl8168_set_eth_phy_bit(tp, 0x11, BIT_11); + rtl8168_clear_eth_phy_bit(tp, 0x11, (BIT_11 | BIT_7)); + rtl8168_set_eth_phy_bit(tp, 0x11, (BIT_11)); + rtl8168_mdio_write(tp, 0x1F, 0x0A43); + rtl8168_clear_eth_phy_bit(tp, 0x10, (BIT_0)); rtl8168_mdio_write(tp, 0x1F, 0x0000);