diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2010-10-22 11:04:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-15 13:24:27 -0500 |
commit | 5eda74a40587139b1d66cd8197cac92ba36e79f4 (patch) | |
tree | 0c41a0befb852b309a844d50ef171538f0fe8712 /drivers/net/wireless/iwlwifi | |
parent | 749ff4efa14df904c22b28e2f7b10a02119a4d5e (diff) |
iwlwifi: avoid commit rxon during scan in iwlagn_bt_traffic_change_work
Avoid sending commands to firmware (including commit_rxon) when scan
is pending and we are calling iwlagn_bt_traffic_change_work simultaneously.
Also comment some innocent race conditions.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index c38daf2d9cfd..b01d81a3550b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -1887,6 +1887,11 @@ static void iwlagn_bt_traffic_change_work(struct work_struct *work) | |||
1887 | struct iwl_rxon_context *ctx; | 1887 | struct iwl_rxon_context *ctx; |
1888 | int smps_request = -1; | 1888 | int smps_request = -1; |
1889 | 1889 | ||
1890 | /* | ||
1891 | * Note: bt_traffic_load can be overridden by scan complete and | ||
1892 | * coex profile notifications. Ignore that since only bad consequence | ||
1893 | * can be not matching debug print with actual state. | ||
1894 | */ | ||
1890 | IWL_DEBUG_INFO(priv, "BT traffic load changes: %d\n", | 1895 | IWL_DEBUG_INFO(priv, "BT traffic load changes: %d\n", |
1891 | priv->bt_traffic_load); | 1896 | priv->bt_traffic_load); |
1892 | 1897 | ||
@@ -1909,6 +1914,16 @@ static void iwlagn_bt_traffic_change_work(struct work_struct *work) | |||
1909 | 1914 | ||
1910 | mutex_lock(&priv->mutex); | 1915 | mutex_lock(&priv->mutex); |
1911 | 1916 | ||
1917 | /* | ||
1918 | * We can not send command to firmware while scanning. When the scan | ||
1919 | * complete we will schedule this work again. We do check with mutex | ||
1920 | * locked to prevent new scan request to arrive. We do not check | ||
1921 | * STATUS_SCANNING to avoid race when queue_work two times from | ||
1922 | * different notifications, but quit and not perform any work at all. | ||
1923 | */ | ||
1924 | if (test_bit(STATUS_SCAN_HW, &priv->status)) | ||
1925 | goto out; | ||
1926 | |||
1912 | if (priv->cfg->ops->lib->update_chain_flags) | 1927 | if (priv->cfg->ops->lib->update_chain_flags) |
1913 | priv->cfg->ops->lib->update_chain_flags(priv); | 1928 | priv->cfg->ops->lib->update_chain_flags(priv); |
1914 | 1929 | ||
@@ -1918,7 +1933,7 @@ static void iwlagn_bt_traffic_change_work(struct work_struct *work) | |||
1918 | ieee80211_request_smps(ctx->vif, smps_request); | 1933 | ieee80211_request_smps(ctx->vif, smps_request); |
1919 | } | 1934 | } |
1920 | } | 1935 | } |
1921 | 1936 | out: | |
1922 | mutex_unlock(&priv->mutex); | 1937 | mutex_unlock(&priv->mutex); |
1923 | } | 1938 | } |
1924 | 1939 | ||