diff options
author | Jeremy Linton <jeremy.linton@arm.com> | 2016-11-17 10:14:25 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-18 13:40:36 -0500 |
commit | 06ba3b2133dc203e1e9bc36cee7f0839b79a9e8b (patch) | |
tree | 25f9ec53021407833ae5c8d6edf1405b3d3216b6 | |
parent | 30a391a13ab9215d7569da4e1773c5bb4deed96d (diff) |
net: sky2: Fix shutdown crash
The sky2 frequently crashes during machine shutdown with:
sky2_get_stats+0x60/0x3d8 [sky2]
dev_get_stats+0x68/0xd8
rtnl_fill_stats+0x54/0x140
rtnl_fill_ifinfo+0x46c/0xc68
rtmsg_ifinfo_build_skb+0x7c/0xf0
rtmsg_ifinfo.part.22+0x3c/0x70
rtmsg_ifinfo+0x50/0x5c
netdev_state_change+0x4c/0x58
linkwatch_do_dev+0x50/0x88
__linkwatch_run_queue+0x104/0x1a4
linkwatch_event+0x30/0x3c
process_one_work+0x140/0x3e0
worker_thread+0x60/0x44c
kthread+0xdc/0xf0
ret_from_fork+0x10/0x50
This is caused by the sky2 being called after it has been shutdown.
A previous thread about this can be found here:
https://lkml.org/lkml/2016/4/12/410
An alternative fix is to assure that IFF_UP gets cleared by
calling dev_close() during shutdown. This is similar to what the
bnx2/tg3/xgene and maybe others are doing to assure that the driver
isn't being called following _shutdown().
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/marvell/sky2.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index f05ea56dcff2..941c8e2c944e 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c | |||
@@ -5220,6 +5220,19 @@ static SIMPLE_DEV_PM_OPS(sky2_pm_ops, sky2_suspend, sky2_resume); | |||
5220 | 5220 | ||
5221 | static void sky2_shutdown(struct pci_dev *pdev) | 5221 | static void sky2_shutdown(struct pci_dev *pdev) |
5222 | { | 5222 | { |
5223 | struct sky2_hw *hw = pci_get_drvdata(pdev); | ||
5224 | int port; | ||
5225 | |||
5226 | for (port = 0; port < hw->ports; port++) { | ||
5227 | struct net_device *ndev = hw->dev[port]; | ||
5228 | |||
5229 | rtnl_lock(); | ||
5230 | if (netif_running(ndev)) { | ||
5231 | dev_close(ndev); | ||
5232 | netif_device_detach(ndev); | ||
5233 | } | ||
5234 | rtnl_unlock(); | ||
5235 | } | ||
5223 | sky2_suspend(&pdev->dev); | 5236 | sky2_suspend(&pdev->dev); |
5224 | pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev)); | 5237 | pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev)); |
5225 | pci_set_power_state(pdev, PCI_D3hot); | 5238 | pci_set_power_state(pdev, PCI_D3hot); |