[08/19] net/ngbe: keep PHY power down while device probing

Message ID 20240617095319.16664-9-jiawenwu@trustnetic.com (mailing list archive)
State Superseded
Headers
Series Wangxun fixes and supports |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jiawen Wu June 17, 2024, 9:53 a.m. UTC
  The internal PHY will be set to default power down after LAN reset,
but the external PHY will not. To keep the PHY behavior consistent,
set PHY power down uniformly here.

Fixes: 708ebe7d0399 ("net/ngbe: fix external PHY power down")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/ngbe/base/ngbe_devids.h | 1 +
 drivers/net/ngbe/base/ngbe_hw.c     | 3 +++
 2 files changed, 4 insertions(+)
  

Patch

diff --git a/drivers/net/ngbe/base/ngbe_devids.h b/drivers/net/ngbe/base/ngbe_devids.h
index 83eedf423e..e1efa62015 100644
--- a/drivers/net/ngbe/base/ngbe_devids.h
+++ b/drivers/net/ngbe/base/ngbe_devids.h
@@ -83,6 +83,7 @@ 
 #define NGBE_YT8521S_SFP_GPIO			0x0062
 #define NGBE_INTERNAL_YT8521S_SFP_GPIO		0x0064
 #define NGBE_LY_YT8521S_SFP			0x0070
+#define NGBE_RGMII_FPGA				0x0080
 #define NGBE_WOL_SUP				0x4000
 #define NGBE_NCSI_SUP				0x8000
 
diff --git a/drivers/net/ngbe/base/ngbe_hw.c b/drivers/net/ngbe/base/ngbe_hw.c
index 22ccdb0b7d..4dced0d328 100644
--- a/drivers/net/ngbe/base/ngbe_hw.c
+++ b/drivers/net/ngbe/base/ngbe_hw.c
@@ -173,6 +173,9 @@  s32 ngbe_reset_hw_em(struct ngbe_hw *hw)
 	ngbe_reset_misc_em(hw);
 	hw->mac.clear_hw_cntrs(hw);
 
+	if (!((hw->sub_device_id & NGBE_OEM_MASK) == NGBE_RGMII_FPGA))
+		hw->phy.set_phy_power(hw, false);
+
 	msec_delay(50);
 
 	/* Store the permanent mac address */