[04/11] net/ngbe: prevent the NIC from slowing down link speed

Message ID 20230928094758.1076236-5-jiawenwu@trustnetic.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series Wanguxn NICs fixes and supports |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jiawen Wu Sept. 28, 2023, 9:47 a.m. UTC
  When the signal quality is bad, the internal PHY may slow down to 100M.
Fix this weird behavior by setting dis fall 100M bit.

Fixes: 696a82117875 ("net/ngbe: redesign internal PHY init flow")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/ngbe/base/ngbe_phy_rtl.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/drivers/net/ngbe/base/ngbe_phy_rtl.c b/drivers/net/ngbe/base/ngbe_phy_rtl.c
index b0eb6c97c0..ba63a8058a 100644
--- a/drivers/net/ngbe/base/ngbe_phy_rtl.c
+++ b/drivers/net/ngbe/base/ngbe_phy_rtl.c
@@ -148,6 +148,11 @@  s32 ngbe_init_phy_rtl(struct ngbe_hw *hw)
 	hw->phy.write_reg(hw, 27, 0xa42, 0x8011);
 	hw->phy.write_reg(hw, 28, 0xa42, 0x5737);
 
+	/* Disable fall to 100m if signal is not good */
+	hw->phy.read_reg(hw, 17, 0xa44, &value);
+	value &= ~0x8;
+	hw->phy.write_reg(hw, 17, 0xa44, value);
+
 	hw->phy.write_reg(hw, RTL_SCR, 0xa46, RTL_SCR_EXTINI);
 	hw->phy.read_reg(hw, RTL_SCR, 0xa46, &value);
 	if (!(value & RTL_SCR_EXTINI)) {