* [PATCH v1 net 0/2] Refactor PHY reset handling and
@ 2025-05-23 5:43 Thangaraj Samynathan
2025-05-23 5:43 ` [PATCH v1 net 1/2] net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy Thangaraj Samynathan
2025-05-23 5:43 ` [PATCH v1 net 2/2] net: lan743x: Fix PHY reset handling during initialization and WOL Thangaraj Samynathan
0 siblings, 2 replies; 6+ messages in thread
From: Thangaraj Samynathan @ 2025-05-23 5:43 UTC (permalink / raw)
To: bryan.whitehead, UNGLinuxDriver, andrew+netdev, davem, edumazet,
kuba, pabeni, netdev, linux-kernel
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.
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(-)
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 net 1/2] net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy
2025-05-23 5:43 [PATCH v1 net 0/2] Refactor PHY reset handling and Thangaraj Samynathan
@ 2025-05-23 5:43 ` Thangaraj Samynathan
2025-05-23 16:24 ` Andrew Lunn
2025-05-23 5:43 ` [PATCH v1 net 2/2] net: lan743x: Fix PHY reset handling during initialization and WOL Thangaraj Samynathan
1 sibling, 1 reply; 6+ messages in thread
From: Thangaraj Samynathan @ 2025-05-23 5:43 UTC (permalink / raw)
To: bryan.whitehead, UNGLinuxDriver, andrew+netdev, davem, edumazet,
kuba, pabeni, netdev, linux-kernel
rename the function to lan743x_hw_reset_phy to better describe it
operatioin
Fixes: 23f0703c125be ("lan743x: Add main source files for new lan743x driver")
Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
---
drivers/net/ethernet/microchip/lan743x_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 7e71579632f3..efa569b670cb 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -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)
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1 net 2/2] net: lan743x: Fix PHY reset handling during initialization and WOL
2025-05-23 5:43 [PATCH v1 net 0/2] Refactor PHY reset handling and Thangaraj Samynathan
2025-05-23 5:43 ` [PATCH v1 net 1/2] net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy Thangaraj Samynathan
@ 2025-05-23 5:43 ` Thangaraj Samynathan
2025-05-23 16:25 ` Andrew Lunn
1 sibling, 1 reply; 6+ messages in thread
From: Thangaraj Samynathan @ 2025-05-23 5:43 UTC (permalink / raw)
To: bryan.whitehead, UNGLinuxDriver, andrew+netdev, davem, edumazet,
kuba, pabeni, netdev, linux-kernel
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")
Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
---
drivers/net/ethernet/microchip/lan743x_main.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index efa569b670cb..9d70b51ca91d 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -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;
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1 net 1/2] net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy
2025-05-23 5:43 ` [PATCH v1 net 1/2] net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy Thangaraj Samynathan
@ 2025-05-23 16:24 ` Andrew Lunn
2025-05-26 5:29 ` Thangaraj.S
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2025-05-23 16:24 UTC (permalink / raw)
To: Thangaraj Samynathan
Cc: bryan.whitehead, UNGLinuxDriver, andrew+netdev, davem, edumazet,
kuba, pabeni, netdev, linux-kernel
On Fri, May 23, 2025 at 11:13:24AM +0530, Thangaraj Samynathan wrote:
> rename the function to lan743x_hw_reset_phy to better describe it
> operatioin
operation.
With that fixed please add: Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
---
pw-bot: cr
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 net 2/2] net: lan743x: Fix PHY reset handling during initialization and WOL
2025-05-23 5:43 ` [PATCH v1 net 2/2] net: lan743x: Fix PHY reset handling during initialization and WOL Thangaraj Samynathan
@ 2025-05-23 16:25 ` Andrew Lunn
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2025-05-23 16:25 UTC (permalink / raw)
To: Thangaraj Samynathan
Cc: bryan.whitehead, UNGLinuxDriver, andrew+netdev, davem, edumazet,
kuba, pabeni, netdev, linux-kernel
On Fri, May 23, 2025 at 11:13:25AM +0530, Thangaraj Samynathan wrote:
> 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")
> Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 net 1/2] net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy
2025-05-23 16:24 ` Andrew Lunn
@ 2025-05-26 5:29 ` Thangaraj.S
0 siblings, 0 replies; 6+ messages in thread
From: Thangaraj.S @ 2025-05-26 5:29 UTC (permalink / raw)
To: andrew
Cc: andrew+netdev, Bryan.Whitehead, davem, linux-kernel, netdev,
pabeni, edumazet, kuba, UNGLinuxDriver
Hi Andrew,
Thanks for reviewing the patch.
On Fri, 2025-05-23 at 18:24 +0200, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> On Fri, May 23, 2025 at 11:13:24AM +0530, Thangaraj Samynathan wrote:
> > rename the function to lan743x_hw_reset_phy to better describe it
> > operatioin
>
> operation.
>
> With that fixed please add: Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> Andrew
>
> ---
Sure, will update the same in next revision.
> pw-bot: cr
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-26 5:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23 5:43 [PATCH v1 net 0/2] Refactor PHY reset handling and Thangaraj Samynathan
2025-05-23 5:43 ` [PATCH v1 net 1/2] net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy Thangaraj Samynathan
2025-05-23 16:24 ` Andrew Lunn
2025-05-26 5:29 ` Thangaraj.S
2025-05-23 5:43 ` [PATCH v1 net 2/2] net: lan743x: Fix PHY reset handling during initialization and WOL Thangaraj Samynathan
2025-05-23 16:25 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).