Skip to content

Commit

Permalink
net: axienet: stop interface during shutdown
Browse files Browse the repository at this point in the history
On some platforms, such as iMX6 with PCIe devices, crashes or hangs can
occur if the axienet device continues to perform DMA transfers after
parent devices/busses have been shut down. Shut down the axienet
interface during its shutdown callback in order to avoid this.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Robert Hancock authored and David S. Miller committed Jun 6, 2019
1 parent d05a9ed commit 70c5026
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/net/ethernet/xilinx/xilinx_axienet_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,9 +1797,23 @@ static int axienet_remove(struct platform_device *pdev)
return 0;
}

static void axienet_shutdown(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);

rtnl_lock();
netif_device_detach(ndev);

if (netif_running(ndev))
dev_close(ndev);

rtnl_unlock();
}

static struct platform_driver axienet_driver = {
.probe = axienet_probe,
.remove = axienet_remove,
.shutdown = axienet_shutdown,
.driver = {
.name = "xilinx_axienet",
.of_match_table = axienet_of_match,
Expand Down

0 comments on commit 70c5026

Please sign in to comment.