diff options
author | Zhu Yi <yi.zhu@intel.com> | 2007-12-19 00:59:52 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-12-19 21:31:01 -0500 |
commit | b24d22b1d12c436a86282347868785207cff8a88 (patch) | |
tree | 90a6c107466be49653c2a5b92b82fb3eb77c211d /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 7d2e941b0b741d17e95baf095dbf1c77f2b95b56 (diff) |
iwlwifi: fix possible priv->mutex deadlock during suspend
This patch moves _cancel_deferred_work out of mutex protection and removes
unnecessary mutex in pci_suspend and pci_resume.
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 4bdf237f6adc..5c67b5b409e0 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6243,8 +6243,6 @@ static void __iwl_down(struct iwl_priv *priv) | |||
6243 | /* Unblock any waiting calls */ | 6243 | /* Unblock any waiting calls */ |
6244 | wake_up_interruptible_all(&priv->wait_command_queue); | 6244 | wake_up_interruptible_all(&priv->wait_command_queue); |
6245 | 6245 | ||
6246 | iwl_cancel_deferred_work(priv); | ||
6247 | |||
6248 | /* Wipe out the EXIT_PENDING status bit if we are not actually | 6246 | /* Wipe out the EXIT_PENDING status bit if we are not actually |
6249 | * exiting the module */ | 6247 | * exiting the module */ |
6250 | if (!exit_pending) | 6248 | if (!exit_pending) |
@@ -6319,6 +6317,8 @@ static void iwl_down(struct iwl_priv *priv) | |||
6319 | mutex_lock(&priv->mutex); | 6317 | mutex_lock(&priv->mutex); |
6320 | __iwl_down(priv); | 6318 | __iwl_down(priv); |
6321 | mutex_unlock(&priv->mutex); | 6319 | mutex_unlock(&priv->mutex); |
6320 | |||
6321 | iwl_cancel_deferred_work(priv); | ||
6322 | } | 6322 | } |
6323 | 6323 | ||
6324 | #define MAX_HW_RESTARTS 5 | 6324 | #define MAX_HW_RESTARTS 5 |
@@ -8577,10 +8577,9 @@ static void iwl_pci_remove(struct pci_dev *pdev) | |||
8577 | 8577 | ||
8578 | IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n"); | 8578 | IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n"); |
8579 | 8579 | ||
8580 | mutex_lock(&priv->mutex); | ||
8581 | set_bit(STATUS_EXIT_PENDING, &priv->status); | 8580 | set_bit(STATUS_EXIT_PENDING, &priv->status); |
8582 | __iwl_down(priv); | 8581 | |
8583 | mutex_unlock(&priv->mutex); | 8582 | iwl_down(priv); |
8584 | 8583 | ||
8585 | /* Free MAC hash list for ADHOC */ | 8584 | /* Free MAC hash list for ADHOC */ |
8586 | for (i = 0; i < IWL_IBSS_MAC_HASH_SIZE; i++) { | 8585 | for (i = 0; i < IWL_IBSS_MAC_HASH_SIZE; i++) { |
@@ -8639,12 +8638,10 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
8639 | { | 8638 | { |
8640 | struct iwl_priv *priv = pci_get_drvdata(pdev); | 8639 | struct iwl_priv *priv = pci_get_drvdata(pdev); |
8641 | 8640 | ||
8642 | mutex_lock(&priv->mutex); | ||
8643 | |||
8644 | set_bit(STATUS_IN_SUSPEND, &priv->status); | 8641 | set_bit(STATUS_IN_SUSPEND, &priv->status); |
8645 | 8642 | ||
8646 | /* Take down the device; powers it off, etc. */ | 8643 | /* Take down the device; powers it off, etc. */ |
8647 | __iwl_down(priv); | 8644 | iwl_down(priv); |
8648 | 8645 | ||
8649 | if (priv->mac80211_registered) | 8646 | if (priv->mac80211_registered) |
8650 | ieee80211_stop_queues(priv->hw); | 8647 | ieee80211_stop_queues(priv->hw); |
@@ -8653,8 +8650,6 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
8653 | pci_disable_device(pdev); | 8650 | pci_disable_device(pdev); |
8654 | pci_set_power_state(pdev, PCI_D3hot); | 8651 | pci_set_power_state(pdev, PCI_D3hot); |
8655 | 8652 | ||
8656 | mutex_unlock(&priv->mutex); | ||
8657 | |||
8658 | return 0; | 8653 | return 0; |
8659 | } | 8654 | } |
8660 | 8655 | ||
@@ -8712,8 +8707,6 @@ static int iwl_pci_resume(struct pci_dev *pdev) | |||
8712 | 8707 | ||
8713 | printk(KERN_INFO "Coming out of suspend...\n"); | 8708 | printk(KERN_INFO "Coming out of suspend...\n"); |
8714 | 8709 | ||
8715 | mutex_lock(&priv->mutex); | ||
8716 | |||
8717 | pci_set_power_state(pdev, PCI_D0); | 8710 | pci_set_power_state(pdev, PCI_D0); |
8718 | err = pci_enable_device(pdev); | 8711 | err = pci_enable_device(pdev); |
8719 | pci_restore_state(pdev); | 8712 | pci_restore_state(pdev); |
@@ -8727,7 +8720,6 @@ static int iwl_pci_resume(struct pci_dev *pdev) | |||
8727 | pci_write_config_byte(pdev, 0x41, 0x00); | 8720 | pci_write_config_byte(pdev, 0x41, 0x00); |
8728 | 8721 | ||
8729 | iwl_resume(priv); | 8722 | iwl_resume(priv); |
8730 | mutex_unlock(&priv->mutex); | ||
8731 | 8723 | ||
8732 | return 0; | 8724 | return 0; |
8733 | } | 8725 | } |