Commit 81ac3462 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

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.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Tested-by: default avatarLennert Buytenhek <buytenh@marvell.com>
Tested-by: default avatarKalle Valo <kalle.valo@iki.fi>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 34a6eddb
...@@ -284,6 +284,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) ...@@ -284,6 +284,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
ieee80211_mlme_notify_scan_completed(local); ieee80211_mlme_notify_scan_completed(local);
ieee80211_ibss_notify_scan_completed(local); ieee80211_ibss_notify_scan_completed(local);
ieee80211_mesh_notify_scan_completed(local); ieee80211_mesh_notify_scan_completed(local);
ieee80211_queue_work(&local->hw, &local->work_work);
} }
EXPORT_SYMBOL(ieee80211_scan_completed); EXPORT_SYMBOL(ieee80211_scan_completed);
......
...@@ -818,6 +818,7 @@ static void ieee80211_work_work(struct work_struct *work) ...@@ -818,6 +818,7 @@ static void ieee80211_work_work(struct work_struct *work)
wk->chan == local->tmp_channel && wk->chan == local->tmp_channel &&
wk->chan_type == local->tmp_channel_type) { wk->chan_type == local->tmp_channel_type) {
wk->started = true; wk->started = true;
wk->timeout = jiffies;
} }
if (!wk->started && !local->tmp_channel) { if (!wk->started && !local->tmp_channel) {
...@@ -935,6 +936,9 @@ void ieee80211_add_work(struct ieee80211_work *wk) ...@@ -935,6 +936,9 @@ void ieee80211_add_work(struct ieee80211_work *wk)
if (WARN_ON(!wk->done)) if (WARN_ON(!wk->done))
return; return;
if (WARN_ON(!ieee80211_sdata_running(wk->sdata)))
return;
wk->started = false; wk->started = false;
local = wk->sdata->local; local = wk->sdata->local;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment