Skip to contentSkip to conversation

mac80211: fix a few work bugs

PATCH In review Johannes Berg 3 participants 4 messages Jan 6, 2010 – Jan 7, 2010 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: fix a few work bugs

Kalle and Lennert reported problems with the new work code, and at least Kalle's problem I was able to trace to a missing jiffies initialisation.

I also ran into a problem where occasionally I couldn't connect, which seems fixed with kicking the work items after scanning.

Finally, also add some sanity checking code to verify that we're not adding work items while an interface is down -- that case could lead to something similar to what Lennert was seeing.

There still seems to be a race condition that we're trying to figure out separately.

---
 net/mac80211/scan.c |    1 +
 net/mac80211/work.c |    4 ++++
 2 files changed, 5 insertions(+)
net/mac80211/scan.c +1 -0
@@ -285,6 +285,7 @@ void ieee80211_scan_completed(struct iee
 	ieee80211_mlme_notify_scan_completed(local);
 	ieee80211_ibss_notify_scan_completed(local);
 	ieee80211_mesh_notify_scan_completed(local);
+	ieee80211_queue_work(&local->hw, &local->work_work);
 }
 EXPORT_SYMBOL(ieee80211_scan_completed);
 
net/mac80211/work.c +4 -0
@@ -818,6 +818,7 @@ static void ieee80211_work_work(struct w
 		    wk->chan == local->tmp_channel &&
 		    wk->chan_type == local->tmp_channel_type) {
 			wk->started = true;
+			wk->timeout = jiffies;
 		}
 
 		if (!wk->started && !local->tmp_channel) {
@@ -935,6 +936,9 @@ void ieee80211_add_work(struct ieee80211
 	if (WARN_ON(!wk->done))
 		return;
 
+	if (WARN_ON(!ieee80211_sdata_running(wk->sdata)))
+		return;
+
 	wk->started = false;
 
 	local = wk->sdata->local;
Tested-by on v1 1/1
#1 lore raw
Quoted 13 lines · Johannes Berg

Kalle and Lennert reported problems with the new work code, and at least Kalle's problem I was able to trace to a missing jiffies initialisation.

I also ran into a problem where occasionally I couldn't connect, which seems fixed with kicking the work items after scanning.

Finally, also add some sanity checking code to verify that we're not adding work items while an interface is down -- that case could lead to something similar to what Lennert was seeing.

Quoted 4 lines

There still seems to be a race condition that we're trying to figure out separately.

Tested-by on v1 1/1
#2 lore raw
In reply to Johannes Berg
Quoted 8 lines · Johannes Berg

Kalle and Lennert reported problems with the new work code, and at least Kalle's problem I was able to trace to a missing jiffies initialisation.

I also ran into a problem where occasionally I couldn't connect, which seems fixed with kicking the work items after scanning.

Quoted 7 lines

Finally, also add some sanity checking code to verify that we're not adding work items while an interface is down -- that case could lead to something similar to what Lennert was seeing.

There still seems to be a race condition that we're trying to figure out separately.

This seems to help with my problem, it associated quickly:

Jan  6 18:05:36 tikku kernel: [  153.527515] wlan0: direct probe
responded
Jan  6 18:05:36 tikku kernel: [  153.536061] wlan0: authenticate with
00:1e:ab:10:e0:c2 (try 1)
Jan  6 18:05:36 tikku kernel: [  153.537910] wlan0: authenticated
Jan  6 18:05:36 tikku kernel: [  153.537924] phy0: device now idle
Jan  6 18:05:36 tikku kernel: [  153.538563] wlan0: associate with
00:1e:ab:10:e0:c2 (try 1)
Jan  6 18:05:36 tikku kernel: [  153.538578] phy0: device no longer
idle - working
Jan  6 18:05:36 tikku kernel: [  153.578808] wlan0: RX AssocResp from
00:1e:ab:10:e0:c2 (capab=0x11 status=0 aid=1)
Jan  6 18:05:36 tikku kernel: [  153.578814] wlan0: associated

Because I'm currently travelling, I have tested this only once. Will test more when I get back home.

Thanks for the patch.

Quoted 1 line
Signature · 1 line
Kalle Valo
#3 lore raw
Quoted 9 lines · Kalle Valo
Quoted 7 lines · Johannes Berg

Kalle and Lennert reported problems with the new work code, and at least Kalle's problem I was able to trace to a missing jiffies initialisation.

I also ran into a problem where occasionally I couldn't connect, which seems fixed with kicking the work items after scanning.

[...]

Quoted 2 lines

Because I'm currently travelling, I have tested this only once. Will test more when I get back home.

I have now tested this by rebooting few times and I didn't notice any problems. So the patch seems to really help.

Signature · 1 line
Kalle Valo