]> Pileus Git - ~andy/linux/commit
mac80211: fix station wakeup powersave race
authorJohannes Berg <johannes.berg@intel.com>
Thu, 20 Feb 2014 10:19:58 +0000 (11:19 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 20 Feb 2014 10:54:09 +0000 (11:54 +0100)
commite3685e03b40f5ec7926d9a75bf63467fc4071df9
treef6f4c829383110cdd9f579f0ee028938f6945e42
parent5108ca828017120981880eeec8a9ec369334a899
mac80211: fix station wakeup powersave race

Consider the following (relatively unlikely) scenario:
 1) station goes to sleep while frames are buffered in driver
 2) driver blocks wakeup (until no more frames are buffered)
 3) station wakes up again
 4) driver unblocks wakeup

In this case, the current mac80211 code will do the following:
 1) WLAN_STA_PS_STA set
 2) WLAN_STA_PS_DRIVER set
 3) - nothing -
 4) WLAN_STA_PS_DRIVER cleared

As a result, no frames will be delivered to the client, even
though it is awake, until it sends another frame to us that
triggers ieee80211_sta_ps_deliver_wakeup() in sta_ps_end().

Since we now take the PS spinlock, we can fix this while at
the same time removing the complexity with the pending skb
queue function. This was broken since my commit 50a9432daeec
("mac80211: fix powersaving clients races") due to removing
the clearing of WLAN_STA_PS_STA in the RX path.

While at it, fix a cleanup path issue when a station is
removed while the driver is still blocking its wakeup.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ieee80211_i.h
net/mac80211/rx.c
net/mac80211/sta_info.c
net/mac80211/util.c