aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2012-01-04 15:23:33 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-05 13:12:03 -0500
commit3a3847e007aae732d64d8fd1374126393e9879a3 (patch)
treea333ee4a5f369b6027ce16db120858877247d17a /drivers/net/ethernet/intel/e1000
parent1032c736e81cdf490ae62f86da7efe67c3c3e61d (diff)
e1000: fix lockdep splat in shutdown handler
As reported by Steven Rostedt, e1000 has a lockdep splat added during the recent merge window. The issue is that cancel_delayed_work is called while holding our private mutex. There is no reason that I can see to hold the mutex during pci shutdown, it was more just paranoia that I put the mutex_lock around the call to e1000_down. In a quick survey lots of drivers handle locking differently when being called by the pci layer. The assumption here is that we don't need the mutexes' protection in this function because the driver could not be unloaded while in the shutdown handler which is only called at reboot or poweroff. Reported-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Steven Rostedt <rostedt@goodmis.org> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000')
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 985d58943a06..934d5aaee22f 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -4724,8 +4724,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
4724 4724
4725 netif_device_detach(netdev); 4725 netif_device_detach(netdev);
4726 4726
4727 mutex_lock(&adapter->mutex);
4728
4729 if (netif_running(netdev)) { 4727 if (netif_running(netdev)) {
4730 WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags)); 4728 WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags));
4731 e1000_down(adapter); 4729 e1000_down(adapter);
@@ -4733,10 +4731,8 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
4733 4731
4734#ifdef CONFIG_PM 4732#ifdef CONFIG_PM
4735 retval = pci_save_state(pdev); 4733 retval = pci_save_state(pdev);
4736 if (retval) { 4734 if (retval)
4737 mutex_unlock(&adapter->mutex);
4738 return retval; 4735 return retval;
4739 }
4740#endif 4736#endif
4741 4737
4742 status = er32(STATUS); 4738 status = er32(STATUS);
@@ -4791,8 +4787,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
4791 if (netif_running(netdev)) 4787 if (netif_running(netdev))
4792 e1000_free_irq(adapter); 4788 e1000_free_irq(adapter);
4793 4789
4794 mutex_unlock(&adapter->mutex);
4795
4796 pci_disable_device(pdev); 4790 pci_disable_device(pdev);
4797 4791
4798 return 0; 4792 return 0;