* [PATCH] mac80211: remove bogus mod_timer() call
@ 2010-05-26 14:41 Johannes Berg
0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2010-05-26 14:41 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
The IBSS code has a bogus mod_timer(..., 0) call,
we shouldn't ever pass a constant value to the
function since any constant value could be in the
future or the past.
However, invoking the timer here is not necessary
at all, since we just finished scanning and just
need to have the IBSS code run again from the
workqueue later, so factor out the work starting
and use that instead.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
The problem was introduced in 2.6.32 ... not sure if that means it
should be sent to stable or not, I guess not since we haven't really had
issues with it that I know of.
net/mac80211/ibss.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
--- wireless-testing.orig/net/mac80211/ibss.c 2010-05-25 20:44:41.000000000 +0200
+++ wireless-testing/net/mac80211/ibss.c 2010-05-25 20:45:57.000000000 +0200
@@ -798,6 +798,15 @@ static void ieee80211_ibss_work(struct w
}
}
+static void ieee80211_queue_ibss_work(struct ieee80211_sub_if_data *sdata)
+{
+ struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
+ struct ieee80211_local *local = sdata->local;
+
+ set_bit(IEEE80211_IBSS_REQ_RUN, &ifibss->request);
+ ieee80211_queue_work(&local->hw, &ifibss->work);
+}
+
static void ieee80211_ibss_timer(unsigned long data)
{
struct ieee80211_sub_if_data *sdata =
@@ -810,8 +819,7 @@ static void ieee80211_ibss_timer(unsigne
return;
}
- set_bit(IEEE80211_IBSS_REQ_RUN, &ifibss->request);
- ieee80211_queue_work(&local->hw, &ifibss->work);
+ ieee80211_queue_ibss_work(sdata);
}
#ifdef CONFIG_PM
@@ -859,7 +867,7 @@ void ieee80211_ibss_notify_scan_complete
if (!sdata->u.ibss.ssid_len)
continue;
sdata->u.ibss.last_scan_completed = jiffies;
- mod_timer(&sdata->u.ibss.timer, 0);
+ ieee80211_queue_ibss_work(sdata);
}
mutex_unlock(&local->iflist_mtx);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-05-26 14:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 14:41 [PATCH] mac80211: remove bogus mod_timer() call Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).