]> git.baikalelectronics.ru Git - kernel.git/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)
commit97648eed3d997180e3f58e392586fff7bdf34579
treef6f4c829383110cdd9f579f0ee028938f6945e42
parent1f378829a54c917072bc94cb89ed21a75eee3011
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 203889b21a7a
("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