Skip to contentSkip to conversation

Warning when terminating wpa_supplicant (wext driver)

DISCUSSION Marcel Holtmann 3 participants 11 messages May 7, 2009 – May 9, 2009 mac80211

lore
Share & tools
lore
#0 lore raw

Hi guys,

so I am running the wireless-testing.git tree from today and when terminating wpa_supplicant (wext driver), I get this warning in my kernel logs:

------------[ cut here ]------------
WARNING: at net/mac80211/agg-tx.c:142 ___ieee80211_stop_tx_ba_session+0x6b/0x7e [mac80211]()
Hardware name: 7454CTO
Modules linked in: tun fuse sco bluetooth binfmt_misc uinput iwlagn snd_hda_codec_conexant snd_hda_intel iwlcore snd_hda_codec i2400m_usb mbm cdc_ether i2400m usbnet uvcvideo snd_pcm mii mac80211 cdc_acm cdc_wdm snd_timer snd cfg80211 wimax soundcore snd_page_alloc uhci_hcd ehci_hcd [last unloaded: microcode]
Pid: 2741, comm: wpa_supplicant Not tainted 2.6.30-rc4-wl #17
Call Trace:
 [<ffffffff80234b58>] warn_slowpath+0xb1/0xe5
 [<ffffffffa014bda4>] ? iwl_tx_agg_stop+0x297/0x2bd [iwlcore]
 [<ffffffffa018612c>] ? iwl_mac_ampdu_action+0x2ab/0x332 [iwlagn]
 [<ffffffffa0088b02>] ___ieee80211_stop_tx_ba_session+0x6b/0x7e [mac80211]
 [<ffffffffa0088c80>] __ieee80211_stop_tx_ba_session+0x63/0x7b [mac80211]
 [<ffffffffa008890c>] ieee80211_sta_tear_down_BA_sessions+0x1b/0x3b [mac80211]
 [<ffffffffa008f105>] ieee80211_stop+0x9f/0x561 [mac80211]
 [<ffffffff80548124>] ? _spin_unlock_bh+0x1e/0x20
 [<ffffffff804b4583>] ? dev_deactivate+0x156/0x186
 [<ffffffff804a72f3>] dev_close+0x74/0x96
 [<ffffffff804a6f93>] dev_change_flags+0xba/0x180
 [<ffffffff804e3008>] devinet_ioctl+0x278/0x604
 [<ffffffff804e423e>] inet_ioctl+0x92/0xaa
 [<ffffffff80497b8e>] sock_ioctl+0x1f1/0x21b
 [<ffffffff802a5970>] vfs_ioctl+0x2a/0x78
 [<ffffffff802a5dfa>] do_vfs_ioctl+0x43c/0x478
 [<ffffffff802a5e8b>] sys_ioctl+0x55/0x77
 [<ffffffff8020af6b>] system_call_fastpath+0x16/0x1b
---[ end trace 8a26567db4679b5c ]---

The hardware is an Intel 5350 card if that actually matters.

Regards

Marcel

maintainer
#1 lore raw

Copying Wey-Yi, but I think she's aware of this? It's definitely a driver issue. I _suspect_, but am not sure, that the driver kills the aggregation session when we disassoc or something and we only tell it about the STA removal after that, when it already killed the STA. Thus it would be a consequence of iwlwifi not implementing a proper sta_notify() callback.

johannes

Quoted 44 lines · Marcel Holtmann

Hi guys,

so I am running the wireless-testing.git tree from today and when terminating wpa_supplicant (wext driver), I get this warning in my kernel logs:

------------[ cut here ]------------
WARNING: at net/mac80211/agg-tx.c:142 ___ieee80211_stop_tx_ba_session+0x6b/0x7e [mac80211]()
Hardware name: 7454CTO
Modules linked in: tun fuse sco bluetooth binfmt_misc uinput iwlagn snd_hda_codec_conexant snd_hda_intel iwlcore snd_hda_codec i2400m_usb mbm cdc_ether i2400m usbnet uvcvideo snd_pcm mii mac80211 cdc_acm cdc_wdm snd_timer snd cfg80211 wimax soundcore snd_page_alloc uhci_hcd ehci_hcd [last unloaded: microcode]
Pid: 2741, comm: wpa_supplicant Not tainted 2.6.30-rc4-wl #17
Call Trace:
 [<ffffffff80234b58>] warn_slowpath+0xb1/0xe5
 [<ffffffffa014bda4>] ? iwl_tx_agg_stop+0x297/0x2bd [iwlcore]
 [<ffffffffa018612c>] ? iwl_mac_ampdu_action+0x2ab/0x332 [iwlagn]
 [<ffffffffa0088b02>] ___ieee80211_stop_tx_ba_session+0x6b/0x7e [mac80211]
 [<ffffffffa0088c80>] __ieee80211_stop_tx_ba_session+0x63/0x7b [mac80211]
 [<ffffffffa008890c>] ieee80211_sta_tear_down_BA_sessions+0x1b/0x3b [mac80211]
 [<ffffffffa008f105>] ieee80211_stop+0x9f/0x561 [mac80211]
 [<ffffffff80548124>] ? _spin_unlock_bh+0x1e/0x20
 [<ffffffff804b4583>] ? dev_deactivate+0x156/0x186
 [<ffffffff804a72f3>] dev_close+0x74/0x96
 [<ffffffff804a6f93>] dev_change_flags+0xba/0x180
 [<ffffffff804e3008>] devinet_ioctl+0x278/0x604
 [<ffffffff804e423e>] inet_ioctl+0x92/0xaa
 [<ffffffff80497b8e>] sock_ioctl+0x1f1/0x21b
 [<ffffffff802a5970>] vfs_ioctl+0x2a/0x78
 [<ffffffff802a5dfa>] do_vfs_ioctl+0x43c/0x478
 [<ffffffff802a5e8b>] sys_ioctl+0x55/0x77
 [<ffffffff8020af6b>] system_call_fastpath+0x16/0x1b
---[ end trace 8a26567db4679b5c ]---

The hardware is an Intel 5350 card if that actually matters.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Hi Johannes,

Quoted 6 lines

Copying Wey-Yi, but I think she's aware of this? It's definitely a driver issue. I _suspect_, but am not sure, that the driver kills the aggregation session when we disassoc or something and we only tell it about the STA removal after that, when it already killed the STA. Thus it would be a consequence of iwlwifi not implementing a proper sta_notify() callback.

I don't see it with nl80211 driver, but that might be pure luck.

Regards

Marcel

maintainer
#3 lore raw
Quoted 8 lines · Marcel Holtmann
Quoted 6 lines

Copying Wey-Yi, but I think she's aware of this? It's definitely a driver issue. I _suspect_, but am not sure, that the driver kills the aggregation session when we disassoc or something and we only tell it about the STA removal after that, when it already killed the STA. Thus it would be a consequence of iwlwifi not implementing a proper sta_notify() callback.

I don't see it with nl80211 driver, but that might be pure luck.

Hmm, ok, that points to something else maybe... Now I wish I had my ftrace-mac80211 patch ready. Well, the patch is almost ready but we can't use ftrace in modules yet...

Maybe there's some timing issue. I still think it's iwlwifi getting confused about what mac80211 is telling it as described, but it seems it's a little more subtle than what I said.

johannes

#4 lore raw

Hi Johannes,

Quoted 9 lines
Quoted 8 lines
Quoted 6 lines

Copying Wey-Yi, but I think she's aware of this? It's definitely a driver issue. I _suspect_, but am not sure, that the driver kills the aggregation session when we disassoc or something and we only tell it about the STA removal after that, when it already killed the STA. Thus it would be a consequence of iwlwifi not implementing a proper sta_notify() callback.

I don't see it with nl80211 driver, but that might be pure luck.

Quoted 7 lines

Hmm, ok, that points to something else maybe... Now I wish I had my ftrace-mac80211 patch ready. Well, the patch is almost ready but we can't use ftrace in modules yet...

Maybe there's some timing issue. I still think it's iwlwifi getting confused about what mac80211 is telling it as described, but it seems it's a little more subtle than what I said.

something similar now happened during normal operation:

phy0: AddBA: ssn=277, dialog_token=1 tid=0 timeout=0ba_policy=1
addba: d0 08 40 01 00 16 eb 05 46 5c 00 1c f0 62 88 5b
addba: 00 1c f0 62 88 5b e0 54 03 00 01 02 10 00 00 50
addba: 11
Rx A-MPDU request on tid 0 result 0
wlan0: CTS protection enabled (BSSID=00:1c:f0:xx:xx:xx)
wlan0: CTS protection disabled (BSSID=00:1c:f0:xx:xx:xx)
wlan0: no probe response from AP 00:1c:f0:xx:xx:xx - disassociating Tx BA session stop requested for 00:1c:f0:xx:xx:xx tid 0 iwlagn 0000:03:00.0: Invalid station for AGG tid 0

------------[ cut here ]------------
WARNING: at net/mac80211/agg-tx.c:142 ___ieee80211_stop_tx_ba_session+0x6b/0x7e [mac80211]()
Hardware name: 7454CTO
Modules linked in: usb_storage option usbserial iwlagn iwlcore mac80211 cfg80211 tun fuse sco bluetooth binfmt_misc uinput snd_hda_codec_conexant snd_hda_inte
l snd_hda_codec snd_pcm snd_timer snd mbm uvcvideo soundcore cdc_ether i2400m usbnet cdc_acm cdc_wdm mii wimax snd_page_alloc uhci_hcd ehci_hcd [last unloaded
: cfg80211]
Pid: 27738, comm: phy0 Tainted: G        W  2.6.30-rc4-wl #17
Call Trace:
 [<ffffffff80234b58>] warn_slowpath+0xb1/0xe5
 [<ffffffffa0412bd2>] ? iwl_tx_agg_stop+0xc5/0x2bd [iwlcore]
 [<ffffffffa043612c>] ? iwl_mac_ampdu_action+0x2ab/0x332 [iwlagn]
 [<ffffffffa03d2b02>] ___ieee80211_stop_tx_ba_session+0x6b/0x7e [mac80211]
 [<ffffffffa03d2c80>] __ieee80211_stop_tx_ba_session+0x63/0x7b [mac80211]
 [<ffffffffa03d290c>] ieee80211_sta_tear_down_BA_sessions+0x1b/0x3b [mac80211]
 [<ffffffffa03d5a66>] ieee80211_set_disassoc+0xe4/0x2c9 [mac80211]
 [<ffffffffa03d6c77>] ieee80211_associated+0x18b/0x1b0 [mac80211]
 [<ffffffffa03d89c6>] ieee80211_sta_work+0x85d/0x8bb [mac80211]
 [<ffffffff80548227>] ? _spin_unlock_irqrestore+0x8/0x30
 [<ffffffffa03d8169>] ? ieee80211_sta_work+0x0/0x8bb [mac80211]
 [<ffffffff80244081>] worker_thread+0x132/0x1d8
 [<ffffffff80247c7e>] ? autoremove_wake_function+0x0/0x38
 [<ffffffff80243f4f>] ? worker_thread+0x0/0x1d8
 [<ffffffff80243f4f>] ? worker_thread+0x0/0x1d8
 [<ffffffff8024791a>] kthread+0x56/0x83
 [<ffffffff8020bf6a>] child_rip+0xa/0x20
 [<ffffffff802478c4>] ? kthread+0x0/0x83
 [<ffffffff8020bf60>] ? child_rip+0x0/0x20
---[ end trace b434b88b93a5b684 ]---

Rx BA session stop requested for 00:1c:f0:xx:xx:xx tid 0
iwlagn 0000:03:00.0: Invalid station for AGG tid 0
HW problem - can not stop rx aggregation for tid 0
phy0: device now idle
phy0: Removed STA 00:1c:f0:xx:xx:xx
mac80211-phy0: failed to remove key (0, 00:1c:f0:xx:xx:xx) from hardware (-22)
phy0: Destroyed STA 00:1c:f0:xx:xx:xx
phy0: device no longer idle - scanning
phy0: device now idle
phy0: device no longer idle - in use
wlan0: authenticate with AP 00:1c:f0:xx:xx:xx
wlan0: authenticate with AP 00:1c:f0:xx:xx:xx
wlan0: authenticated
phy0: device now idle
phy0: device no longer idle - in use
wlan0: associate with AP 00:1c:f0:xx:xx:xx
wlan0: RX ReassocResp from 00:1c:f0:xx:xx:xx (capab=0x431 status=0 aid=4)
wlan0: associated
phy0: Allocated STA 00:1c:f0:xx:xx:xx
phy0: Inserted STA 00:1c:f0:xx:xx:xx
wmaster0: WMM queue=2 aci=0 acm=0 aifs=3 cWmin=15 cWmax=1023 txop=0
wmaster0: WMM queue=3 aci=1 acm=0 aifs=7 cWmin=15 cWmax=1023 txop=0
wmaster0: WMM queue=1 aci=2 acm=0 aifs=2 cWmin=7 cWmax=15 txop=94
wmaster0: WMM queue=0 aci=3 acm=0 aifs=2 cWmin=3 cWmax=7 txop=47
wlan0: switched to short barker preamble (BSSID=00:1c:f0:xx:xx:xx)
wlan0: switched to short slot time (BSSID=00:1c:f0:xx:xx:xx)
Open BA session requested for 00:1c:f0:xx:xx:xx tid 0
iwlagn 0000:03:00.0: iwl_tx_agg_start on ra = 00:1c:f0:xx:xx:xx tid = 0 activated addBA response timer on tid 0
switched off addBA timer for tid 0
Aggregation is on for tid 0
phy0: AddBA: ssn=118, dialog_token=1 tid=0 timeout=0ba_policy=1
addba: d0 00 40 01 00 16 eb 05 46 5c 00 1c f0 62 88 5b
addba: 00 1c f0 62 88 5b 30 8e 03 00 01 02 10 00 00 60
addba: 07
Rx A-MPDU request on tid 0 result 0

Regards

Marcel

#5 lore raw
Quoted 15 lines · Marcel Holtmann

Hi Johannes,

Quoted 13 lines
Quoted 8 lines
Quoted 6 lines

Copying Wey-Yi, but I think she's aware of this? It's definitely a driver issue. I _suspect_, but am not sure, that the driver kills the aggregation session when we disassoc or something and we only tell it about the STA removal after that, when it already killed the STA. Thus it would be a consequence of iwlwifi not implementing a proper sta_notify() callback.

I don't see it with nl80211 driver, but that might be pure luck.

Hmm, ok, that points to something else maybe... Now I wish I had my ftrace-mac80211 patch ready. Well, the patch is almost ready but we can't use ftrace in modules yet...

Quoted 5 lines
Quoted 3 lines

Maybe there's some timing issue. I still think it's iwlwifi getting confused about what mac80211 is telling it as described, but it seems it's a little more subtle than what I said.

something similar now happened during normal operation:

Just curious, have you applied johill's latest idle fix patch? I've been running iperf overnight with it and my woes are gone. I tested RX though, I'm leaving TX running now but haven't yet seen any warn.

Luis

#6 lore raw
Quoted 20 lines · Luis R. Rodriguez
Quoted 19 lines · Marcel Holtmann

Hi Johannes,

Quoted 16 lines
Quoted 8 lines
Quoted 6 lines

Copying Wey-Yi, but I think she's aware of this? It's definitely a driver issue. I _suspect_, but am not sure, that the driver kills the aggregation session when we disassoc or something and we only tell it about the STA removal after that, when it already killed the STA. Thus it would be a consequence of iwlwifi not implementing a proper sta_notify() callback.

I don't see it with nl80211 driver, but that might be pure luck.

Hmm, ok, that points to something else maybe... Now I wish I had my ftrace-mac80211 patch ready. Well, the patch is almost ready but we can't use ftrace in modules yet...

Maybe there's some timing issue. I still think it's iwlwifi getting confused about what mac80211 is telling it as described, but it seems it's a little more subtle than what I said.

Quoted 5 lines
Quoted 1 line

something similar now happened during normal operation:

Just curious, have you applied johill's latest idle fix patch? I've been running iperf overnight with it and my woes are gone. I tested RX though, I'm leaving TX running now but haven't yet seen any warn.

BTW the patch is

mac80211: fix scan channel race

Luis

#7 lore raw
In reply to Luis R. Rodriguez

Hi Johannes,

Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 8 lines
Quoted 6 lines

Copying Wey-Yi, but I think she's aware of this? It's definitely a driver issue. I _suspect_, but am not sure, that the driver kills the aggregation session when we disassoc or something and we only tell it about the STA removal after that, when it already killed the STA. Thus it would be a consequence of iwlwifi not implementing a proper sta_notify() callback.

I don't see it with nl80211 driver, but that might be pure luck.

Hmm, ok, that points to something else maybe... Now I wish I had my ftrace-mac80211 patch ready. Well, the patch is almost ready but we can't use ftrace in modules yet...

Maybe there's some timing issue. I still think it's iwlwifi getting confused about what mac80211 is telling it as described, but it seems it's a little more subtle than what I said.

Quoted 5 lines
Quoted 1 line

something similar now happened during normal operation:

Just curious, have you applied johill's latest idle fix patch? I've been running iperf overnight with it and my woes are gone. I tested RX though, I'm leaving TX running now but haven't yet seen any warn.

this is still running wireless-testing.git from yesterday with the debug addBA patch from Johannes.

Regards

Marcel

#8 lore raw
Quoted 19 lines · Marcel Holtmann

Hi Johannes,

Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 8 lines
Quoted 6 lines

Copying Wey-Yi, but I think she's aware of this? It's definitely a driver issue. I _suspect_, but am not sure, that the driver kills the aggregation session when we disassoc or something and we only tell it about the STA removal after that, when it already killed the STA. Thus it would be a consequence of iwlwifi not implementing a proper sta_notify() callback.

I don't see it with nl80211 driver, but that might be pure luck.

Hmm, ok, that points to something else maybe... Now I wish I had my ftrace-mac80211 patch ready. Well, the patch is almost ready but we can't use ftrace in modules yet...

Maybe there's some timing issue. I still think it's iwlwifi getting confused about what mac80211 is telling it as described, but it seems it's a little more subtle than what I said.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

something similar now happened during normal operation:

Just curious, have you applied johill's latest idle fix patch? I've been running iperf overnight with it and my woes are gone. I tested RX though, I'm leaving TX running now but haven't yet seen any warn.

this is still running wireless-testing.git from yesterday with the debug addBA patch from Johannes.

Ok yeah wl from yesterday didn't have johill's patch applied yet.

Quoted 1 line

From the looks of it the intel hardware doesn't want to stop the

aggregation session which is API-breakage -- which is why you get the WARN_ON. This is happening when you are disassociating. I have a feeling johill's other patch will fix your issue but regardless I believe this just highlights more we should flush our queues (both RX and TX) before scanning.

Luis

maintainer
#9 lore raw
Quoted 3 lines · Luis R. Rodriguez

From the looks of it the intel hardware doesn't want to stop the aggregation session which is API-breakage -- which is why you get the WARN_ON.

Yup.

Quoted 1 line

This is happening when you are disassociating.

Exactly. But not always, it seems.

Quoted 4 lines

I have a
feeling johill's other patch will fix your issue but regardless I believe this just highlights more we should flush our queues (both RX and TX) before scanning.

It might fix the disassoc, but I don't think it'll fix this issue. Might make it disappear anyway though.

johannes

maintainer
#10 lore raw
In reply to Marcel Holtmann
Quoted 6 lines · Marcel Holtmann

phy0: AddBA: ssn=277, dialog_token=1 tid=0 timeout=0ba_policy=1

Rx A-MPDU request on tid 0 result 0
wlan0: CTS protection enabled (BSSID=00:1c:f0:xx:xx:xx)
wlan0: CTS protection disabled (BSSID=00:1c:f0:xx:xx:xx)
wlan0: no probe response from AP 00:1c:f0:xx:xx:xx - disassociating

At this point we tell the driver we're no longer associated. I think the driver takes that as a reason to remove the station struct it keeps track of in the driver. However,

Quoted 1 line

Tx BA session stop requested for 00:1c:f0:xx:xx:xx tid 0

now we stop the TX BA session

Quoted 1 line

iwlagn 0000:03:00.0: Invalid station for AGG tid 0

and iwlwifi no longer finds the station for it, returns an error

Quoted 2 lines
------------[ cut here ]------------
WARNING: at net/mac80211/agg-tx.c:142 ___ieee80211_stop_tx_ba_session+0x6b/0x7e [mac80211]()

which causes the warning

Quoted 3 lines

Rx BA session stop requested for 00:1c:f0:xx:xx:xx tid 0 iwlagn 0000:03:00.0: Invalid station for AGG tid 0 HW problem - can not stop rx aggregation for tid 0

same here -- but it's not a WARN_ON (though it probably should be!)

Quoted 2 lines

phy0: device now idle
phy0: Removed STA 00:1c:f0:xx:xx:xx

_Now_ mac80211 starts removing the station info.

Quoted 1 line

mac80211-phy0: failed to remove key (0, 00:1c:f0:xx:xx:xx) from hardware (-22)

before it asks the driver to remove the station with sta_notify, it removes the key for the station. But even that fails, since iwlwifi knows nothing about the station.

Quoted 1 line

phy0: Destroyed STA 00:1c:f0:xx:xx:xx

Now mac80211 has gotten rid of the sta struct completely.

I really really think the problem is that iwlwifi insists on keeping track of station information with the wrong callback. It should be using the sta_notify() callback, but it uses the bss_info_changed() callback, which leads to ordering issues because we first tell the driver that we disassociated, and _then_ remove all the information about the STA.

Now, I guess it's debatable whether or not we should tell the driver that we disassociated _before_ we remove the station for the AP. But if we reorder, other drivers might get confused because, well, we first remove the AP STA and then tell them we disassociated -- but what from?

Therefore, I think disassociating first and then removing the station information is correct.

However, to test my theory, you could apply the below patch. I suspect it will no longer happen with this patch and iwlwifi.

Ultimately though I think iwlwifi just needs to be fixed wrt. station handling. A whole lot of complex lookup code will go away because mac80211 passes station structs wherever needed, which will improve performance and reduce code size significantly.

johannes

net/mac80211/mlme.c +3 -3
@@ -1062,9 +1062,6 @@ static void ieee80211_set_disassoc(struc
 		config_changed |= IEEE80211_CONF_CHANGE_PS;
 	}
 
-	ieee80211_hw_config(local, config_changed);
-	ieee80211_bss_info_change_notify(sdata, changed);
-
 	rcu_read_lock();
 
 	sta = sta_info_get(local, ifmgd->bssid);
@@ -1078,6 +1075,9 @@ static void ieee80211_set_disassoc(struc
 	rcu_read_unlock();
 
 	sta_info_destroy(sta);
+
+	ieee80211_hw_config(local, config_changed);
+	ieee80211_bss_info_change_notify(sdata, changed);
 }
 
 static int ieee80211_sta_wep_configured(struct ieee80211_sub_if_data *sdata)