mac80211: fix race between connection monitor & suspend
commit0ecfe806f146e0cb10c2c5abbb3bb4e91959e41a
authorJohannes Berg <johannes.berg@intel.com>
Wed, 9 Nov 2011 11:14:16 +0000 (9 12:14 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 9 Nov 2011 19:35:56 +0000 (9 14:35 -0500)
treee70bd8430b61545e91aacc298718634ac217491f
parentd929bbc63069396e723a180cde9cb71adc9f76ac
mac80211: fix race between connection monitor & suspend

When the connection monitor timer fires right before
suspend, the following will happen:
 timer fires -> monitor_work gets queued
 suspend calls ieee80211_sta_quiesce
 ieee80211_sta_quiesce:
  - deletes timer
  - cancels monitor_work synchronously, running it
  [note wrong order of these steps]
 monitor_work runs, re-arming the timer
 later, timer fires while system should be quiesced

This causes a warning:

WARNING: at net/mac80211/util.c:540 ieee80211_can_queue_work+0x35/0x40 [mac80211]()

but is otherwise harmless. I'm not completely sure
this is the scenario Thomas stumbled across, but it
is the only way I can right now see the warning in
a scenario like the one he reported.

Reported-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mlme.c