aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2015-01-24 03:30:02 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-01-27 03:58:46 -0500
commit9120d94e8f9abd3eb9f00a5aaa6eca85cdf4f439 (patch)
treeb141172aa32ce2fa5f9a531efae302f5c04ac112 /net/mac80211/ieee80211_i.h
parent225b818982403120ce1f5e7d4b3e5245e0399775 (diff)
mac80211: handle potential race between suspend and scan completion
If suspend starts while ieee80211_scan_completed() is running, between the point where SCAN_COMPLETED is set and the work is queued, ieee80211_scan_cancel() will not catch the work and we may finish suspending before the work is actually executed, leaving the scan running while suspended. To fix this race, queue the scan work during resume if the SCAN_COMPLETED flag is set and flush it immediately. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index bdb3e3bc7503..3afe36824703 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1752,7 +1752,8 @@ static inline int __ieee80211_resume(struct ieee80211_hw *hw)
1752{ 1752{
1753 struct ieee80211_local *local = hw_to_local(hw); 1753 struct ieee80211_local *local = hw_to_local(hw);
1754 1754
1755 WARN(test_bit(SCAN_HW_SCANNING, &local->scanning), 1755 WARN(test_bit(SCAN_HW_SCANNING, &local->scanning) &&
1756 !test_bit(SCAN_COMPLETED, &local->scanning),
1756 "%s: resume with hardware scan still in progress\n", 1757 "%s: resume with hardware scan still in progress\n",
1757 wiphy_name(hw->wiphy)); 1758 wiphy_name(hw->wiphy));
1758 1759