diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-06-11 20:45:49 +0300 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-06-26 09:00:26 +0300 |
commit | fa9f3281cbb1075545d4528c84059a3f4e117b44 (patch) | |
tree | 426a4698c9780e96ef5cb34eafe0b1b227336ed4 /drivers/net/wireless/iwlwifi/pcie/drv.c | |
parent | 012c02c15ac63b0b26c7f058c744e85cb563a737 (diff) | |
download | linux-fa9f3281cbb1075545d4528c84059a3f4e117b44.tar.xz |
iwlwifi: pcie: lock start_hw / start_fw / stop_device
This allows to ensure that we don't have races between them.
A user reported that stop_device was called twice upon
rfkill interrupt after suspend. When the interrupts are
enabled, and right after when we directly check the rfkill
state.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie/drv.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/drv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c index 2ed1e4d2774d..dbd2a03a0f6d 100644 --- a/drivers/net/wireless/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c @@ -613,6 +613,7 @@ static int iwl_pci_resume(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); struct iwl_trans *trans = pci_get_drvdata(pdev); + struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); bool hw_rfkill; /* Before you put code here, think about WoWLAN. You cannot check here @@ -643,7 +644,10 @@ static int iwl_pci_resume(struct device *device) } hw_rfkill = iwl_is_rfkill_set(trans); + + mutex_lock(&trans_pcie->mutex); iwl_trans_pcie_rf_kill(trans, hw_rfkill); + mutex_unlock(&trans_pcie->mutex); return 0; } |