aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-08-14 01:15:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-14 18:30:03 -0400
commit19720737187aaee006afb20e63be5e9eddc505a8 (patch)
tree5ecc3d10f36c9ad2b4d4f04bf916797c42e34872 /drivers/net/sky2.c
parent0da6d7b331f391d3c0ce52fb5289f7edeb94e280 (diff)
sky2: hold RTNL when doing suspend/shutdown operations
The suspend and shutdown code plays with shared state. Use consistent locking, for extra protection. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 1d3ee03fa648..3ae4b42fe4d7 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -4643,6 +4643,7 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
4643 del_timer_sync(&hw->watchdog_timer); 4643 del_timer_sync(&hw->watchdog_timer);
4644 cancel_work_sync(&hw->restart_work); 4644 cancel_work_sync(&hw->restart_work);
4645 4645
4646 rtnl_lock();
4646 for (i = 0; i < hw->ports; i++) { 4647 for (i = 0; i < hw->ports; i++) {
4647 struct net_device *dev = hw->dev[i]; 4648 struct net_device *dev = hw->dev[i];
4648 struct sky2_port *sky2 = netdev_priv(dev); 4649 struct sky2_port *sky2 = netdev_priv(dev);
@@ -4660,6 +4661,7 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
4660 sky2_write32(hw, B0_IMSK, 0); 4661 sky2_write32(hw, B0_IMSK, 0);
4661 napi_disable(&hw->napi); 4662 napi_disable(&hw->napi);
4662 sky2_power_aux(hw); 4663 sky2_power_aux(hw);
4664 rtnl_unlock();
4663 4665
4664 pci_save_state(pdev); 4666 pci_save_state(pdev);
4665 pci_enable_wake(pdev, pci_choose_state(pdev, state), wol); 4667 pci_enable_wake(pdev, pci_choose_state(pdev, state), wol);
@@ -4729,6 +4731,7 @@ static void sky2_shutdown(struct pci_dev *pdev)
4729 if (!hw) 4731 if (!hw)
4730 return; 4732 return;
4731 4733
4734 rtnl_lock();
4732 del_timer_sync(&hw->watchdog_timer); 4735 del_timer_sync(&hw->watchdog_timer);
4733 4736
4734 for (i = 0; i < hw->ports; i++) { 4737 for (i = 0; i < hw->ports; i++) {
@@ -4743,6 +4746,7 @@ static void sky2_shutdown(struct pci_dev *pdev)
4743 4746
4744 if (wol) 4747 if (wol)
4745 sky2_power_aux(hw); 4748 sky2_power_aux(hw);
4749 rtnl_unlock();
4746 4750
4747 pci_enable_wake(pdev, PCI_D3hot, wol); 4751 pci_enable_wake(pdev, PCI_D3hot, wol);
4748 pci_enable_wake(pdev, PCI_D3cold, wol); 4752 pci_enable_wake(pdev, PCI_D3cold, wol);