提交 ace19b99 编写于 作者: T Trevor Woerner 提交者: David S. Miller

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.
Fixes: b7370112 ("lpc32xx: Added ethernet driver")
Signed-off-by: NTrevor Woerner <twoerner@gmail.com>
Acked-by: NVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b4ab21f9
...@@ -1015,9 +1015,6 @@ static int lpc_eth_close(struct net_device *ndev) ...@@ -1015,9 +1015,6 @@ static int lpc_eth_close(struct net_device *ndev)
napi_disable(&pldat->napi); napi_disable(&pldat->napi);
netif_stop_queue(ndev); netif_stop_queue(ndev);
if (ndev->phydev)
phy_stop(ndev->phydev);
spin_lock_irqsave(&pldat->lock, flags); spin_lock_irqsave(&pldat->lock, flags);
__lpc_eth_reset(pldat); __lpc_eth_reset(pldat);
netif_carrier_off(ndev); netif_carrier_off(ndev);
...@@ -1025,6 +1022,8 @@ static int lpc_eth_close(struct net_device *ndev) ...@@ -1025,6 +1022,8 @@ static int lpc_eth_close(struct net_device *ndev)
writel(0, LPC_ENET_MAC2(pldat->net_base)); writel(0, LPC_ENET_MAC2(pldat->net_base));
spin_unlock_irqrestore(&pldat->lock, flags); spin_unlock_irqrestore(&pldat->lock, flags);
if (ndev->phydev)
phy_stop(ndev->phydev);
clk_disable_unprepare(pldat->clk); clk_disable_unprepare(pldat->clk);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册