Skip to contentSkip to conversation

Refactor PHY reset handling and

PATCH Applied Thangaraj Samynathan 2 participants 4 messages May 26, 2025 – May 28, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Refactor PHY reset handling and

This patch series refines the PHY reset and initialization logic in the lan743x driver. It includes the following changes

Rename lan743x_reset_phy to lan743x_hw_reset_phy Clarifies the functions purpose as performing a hardware-level PHY reset, improving naming consistency and readability.

Remove lan743x_phy_init and Call lan743x_hw_reset_phy in probe only This function only performed a PHY reset and did not contribute to complete initialization. It has been removed to simplify the initialization sequence. The PHY reset is now performed during probe and removed from the resume path. Resetting the PHY during resume was clearing Wake-on-LAN (WOL) registers, leading to wake-up failures. This change ensures proper PHY setup without interfering with WOL functionality.

These changes enhance the robustness of the driver initialization process and prevent WOL-related issues during suspend/resume cycles.

v1
-Initial Submission

v2
-Corrcted Typo in commit message

Thangaraj Samynathan (2):
net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy
net: lan743x: Fix PHY reset handling during initialization and WOL

 drivers/net/ethernet/microchip/lan743x_main.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/2 net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy

rename the function to lan743x_hw_reset_phy to better describe it operation.

Fixes 23f0703c125be ("lan743x: Add main source files for new lan743x driver")
---
 drivers/net/ethernet/microchip/lan743x_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/microchip/lan743x_main.c +2 -2
index 7e71579632f3..efa569b670cb 100644
@@ -1330,7 +1330,7 @@ static int lan743x_mac_set_mtu(struct lan743x_adapter *adapter, int new_mtu)
 }
 
 /* PHY */
-static int lan743x_phy_reset(struct lan743x_adapter *adapter)
+static int lan743x_hw_reset_phy(struct lan743x_adapter *adapter)
 {
 	u32 data;
 
@@ -1348,7 +1348,7 @@ static int lan743x_phy_reset(struct lan743x_adapter *adapter)
 
 static int lan743x_phy_init(struct lan743x_adapter *adapter)
 {
-	return lan743x_phy_reset(adapter);
+	return lan743x_hw_reset_phy(adapter);
 }
 
 static void lan743x_phy_interface_select(struct lan743x_adapter *adapter)
Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 2/2 net: lan743x: Fix PHY reset handling during initialization and WOL

In reply to Thangaraj Samynathan

Remove lan743x_phy_init from lan743x_hardware_init as it resets the PHY registers, causing WOL to fail on subsequent attempts. Add a call to lan743x_hw_reset_phy in the probe function to ensure the PHY is reset during device initialization.

Fixes 23f0703c125be ("lan743x: Add main source files for new lan743x driver")
---
 drivers/net/ethernet/microchip/lan743x_main.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/net/ethernet/microchip/lan743x_main.c +4 -9
index efa569b670cb..9d70b51ca91d 100644
@@ -1346,11 +1346,6 @@ static int lan743x_hw_reset_phy(struct lan743x_adapter *adapter)
 				  50000, 1000000);
 }
 
-static int lan743x_phy_init(struct lan743x_adapter *adapter)
-{
-	return lan743x_hw_reset_phy(adapter);
-}
-
 static void lan743x_phy_interface_select(struct lan743x_adapter *adapter)
 {
 	u32 id_rev;
@@ -3534,10 +3529,6 @@ static int lan743x_hardware_init(struct lan743x_adapter *adapter,
 	if (ret)
 		return ret;
 
-	ret = lan743x_phy_init(adapter);
-	if (ret)
-		return ret;
-
 	ret = lan743x_ptp_init(adapter);
 	if (ret)
 		return ret;
@@ -3674,6 +3665,10 @@ static int lan743x_pcidev_probe(struct pci_dev *pdev,
 	if (ret)
 		goto cleanup_pci;
 
+	ret = lan743x_hw_reset_phy(adapter);
+	if (ret)
+		goto cleanup_pci;
+
 	ret = lan743x_hardware_init(adapter, pdev);
 	if (ret)
 		goto cleanup_pci;
Signature · 1 line
2.25.1
#3 lore raw
In reply to Thangaraj Samynathan
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Mon, 26 May 2025 11:00:46 +0530 you wrote:

This patch series refines the PHY reset and initialization logic in the lan743x driver. It includes the following changes

Rename lan743x_reset_phy to lan743x_hw_reset_phy Clarifies the functions purpose as performing a hardware-level PHY reset, improving naming consistency and readability.

[...]

Here is the summary with links:
- [v2,net,1/2] net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy

    https://git.kernel.org/netdev/net/c/68927eb52d0a
  - [v2,net,2/2] net: lan743x: Fix PHY reset handling during initialization and WOL
    https://git.kernel.org/netdev/net/c/82d1096ca8b5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html