Skip to content

Commit

Permalink
mac80211: fix a few work bugs
Browse files Browse the repository at this point in the history
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: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Lennert Buytenhek <buytenh@marvell.com>
Tested-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jan 12, 2010
1 parent 34a6edd commit 81ac346
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
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);

Expand Down
4 changes: 4 additions & 0 deletions net/mac80211/work.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ static void ieee80211_work_work(struct work_struct *work)
wk->chan == local->tmp_channel &&
wk->chan_type == local->tmp_channel_type) {
wk->started = true;
wk->timeout = jiffies;
}

if (!wk->started && !local->tmp_channel) {
Expand Down Expand Up @@ -935,6 +936,9 @@ void ieee80211_add_work(struct ieee80211_work *wk)
if (WARN_ON(!wk->done))
return;

if (WARN_ON(!ieee80211_sdata_running(wk->sdata)))
return;

wk->started = false;

local = wk->sdata->local;
Expand Down

0 comments on commit 81ac346

Please sign in to comment.