mac80211: Do not send rc updates to driver before it's initialized station.
This prevents a race condition where the driver may receive updates before it's
fininished initialzing.
b/22846486
See upstream discussion at:
http://comments.gmane.org/gmane.linux.kernel.wireless.general/141276.
To reproduce, I added udelay(1000) in sta_info_insert_finish() before calling
sta_info_insert_drv_state(). Then if I run two scripts below on the client,
I can reproduce in seconds without the patch. With the patch it no longer
fails.
while :; do
iw wlan0 connect <SSID>
sleep 0.1
iw wlan0 disconnect
sleep 0.1
done
while :; do
iw dev wlan0 set power_save off
iw dev wlan0 set power_save on
done
Change-Id: I322e70470f5969cce657f26b8a0ebbd6b0670c6a
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 72ecb20..04b10d1 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -609,6 +609,7 @@
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta, u32 changed)
{
+ struct sta_info *sta_info = container_of(sta, struct sta_info, sta);
sdata = get_bss_sdata(sdata);
if (!check_sdata_in_driver(sdata))
return;
@@ -618,7 +619,7 @@
sdata->vif.type != NL80211_IFTYPE_MESH_POINT));
trace_drv_sta_rc_update(local, sdata, sta, changed);
- if (local->ops->sta_rc_update)
+ if (local->ops->sta_rc_update && sta_info->uploaded)
local->ops->sta_rc_update(&local->hw, &sdata->vif,
sta, changed);