net: nxp: lpc_eth.c: avoid hang when bringing interface down
Subsystems (3)
PATCH 1/1 net: nxp: lpc_eth.c: avoid hang when bringing interface down
A hard hang is observed whenever the ethernet interface is brought down. If the PHY is stopped before the LPC core block is reset, the SoC will hang. Comparing lpc_eth_close() and lpc_eth_open() I re-arranged the ordering of the functions calls in lpc_eth_close() to reset the hardware before stopping the PHY.
--- drivers/net/ethernet/nxp/lpc_eth.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/nxp/lpc_eth.c +2 -3
@@ -1015,9 +1015,6 @@ static int lpc_eth_close(struct net_device *ndev)napi_disable (&pldat->napi);netif_stop_queue (ndev); -if (ndev->phydev) -phy_stop (ndev->phydev); -spin_lock_irqsave (&pldat->lock, flags);__lpc_eth_reset (pldat);netif_carrier_off (ndev);
@@ -1025,6 +1022,8 @@ static int lpc_eth_close(struct net_device *ndev)writel (0 ,LPC_ENET_MAC2 (pldat->net_base));spin_unlock_irqrestore (&pldat->lock, flags); +if (ndev->phydev) +phy_stop (ndev->phydev);clk_disable_unprepare (pldat->clk);return 0 ;
Signature · 1 line
2.30.0.rc0
Hi Trevor,
Quoted 27 lines · Trevor Woerner
A hard hang is observed whenever the ethernet interface is brought down. If the PHY is stopped before the LPC core block is reset, the SoC will hang. Comparing
lpc_eth_close()andlpc_eth_open()I re-arranged the ordering of the functions calls inlpc_eth_close()to reset the hardware before stopping the PHY.Signed-off-by Trevor Woerner <[email protected]>--- drivers/net/ethernet/nxp/lpc_eth.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/net/ethernet/nxp/lpc_eth.c +0
-3@@ -1015,9 +1015,6 @@ static int lpc_eth_close(struct net_device *ndev)napi_disable (&pldat->napi);netif_stop_queue (ndev); -if (ndev->phydev) -phy_stop (ndev->phydev); -spin_lock_irqsave (&pldat->lock, flags);__lpc_eth_reset (pldat);netif_carrier_off (ndev);
drivers/net/ethernet/nxp/lpc_eth.c static int lpc_eth_close(struct net_device *ndev) · line 1029
Quoted 8 lines
drivers/net/ethernet/nxp/lpc_eth.c +2
-0@@ -1025,6 +1022,8 @@ static int lpc_eth_close(struct net_device *ndev)writel (0 ,LPC_ENET_MAC2 (pldat->net_base));spin_unlock_irqrestore (&pldat->lock, flags); +if (ndev->phydev) +phy_stop (ndev->phydev);clk_disable_unprepare (pldat->clk);return 0 ;
thank you for the fix!
--
Best wishes,
Vladimir
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 9 lines · On Sun, 24 Oct 2021 13:50:02 -0400 you wrote:
A hard hang is observed whenever the ethernet interface is brought down. If the PHY is stopped before the LPC core block is reset, the SoC will hang. Comparing
lpc_eth_close()andlpc_eth_open()I re-arranged the ordering of the functions calls inlpc_eth_close()to reset the hardware before stopping the PHY.Signed-off-by Trevor Woerner <[email protected]>[...]
Here is the summary with links:
- net: nxp: lpc_eth.c: avoid hang when bringing interface down
https://git.kernel.org/netdev/net/c/ace19b992436
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html