diff mbox

mac80211: do not trigger beacon loss work if scanning

Message ID 1248389377-30379-1-git-send-email-lrodriguez@atheros.com (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Luis Rodriguez July 23, 2009, 10:49 p.m. UTC
We were issues probe requests to the associated AP on the wrong
band by having our beacon timer loss trigger while we are scanning.
When we would scan the timer could hit and force us to send a
probe request to the AP but with a chance we'd be on the wrong band.

This leads to finding no usable bitrate but we should not get so
far on the xmit path. We should not be trying to send these probe
request frames so prevent the timer from stuffing beacon loss work
on the mac80211 workqueue when scanning.

Tested-by: Fabio Rossi <rossi.f@inwind.it>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 net/mac80211/mlme.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Johannes Berg July 23, 2009, 10:58 p.m. UTC | #1
On Thu, 2009-07-23 at 15:49 -0700, Luis R. Rodriguez wrote:
> We were issues probe requests to the associated AP on the wrong
> band by having our beacon timer loss trigger while we are scanning.
> When we would scan the timer could hit and force us to send a
> probe request to the AP but with a chance we'd be on the wrong band.
> 
> This leads to finding no usable bitrate but we should not get so
> far on the xmit path. We should not be trying to send these probe
> request frames so prevent the timer from stuffing beacon loss work
> on the mac80211 workqueue when scanning.
> 
> Tested-by: Fabio Rossi <rossi.f@inwind.it>
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> ---
>  net/mac80211/mlme.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 523c0d9..e90992e 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -2187,7 +2187,7 @@ static void ieee80211_sta_bcn_mon_timer(unsigned long data)
>  		(struct ieee80211_sub_if_data *) data;
>  	struct ieee80211_local *local = sdata->local;
>  
> -	if (local->quiescing)
> +	if (local->quiescing || local->sw_scanning || local->hw_scanning)

I'd rather have  that check in ieee80211_mgd_probe_ap itself, so it's
much closer to the source of the problem.

johannes
Johannes Berg July 23, 2009, 10:59 p.m. UTC | #2
On Fri, 2009-07-24 at 00:58 +0200, Johannes Berg wrote:

> > @@ -2187,7 +2187,7 @@ static void ieee80211_sta_bcn_mon_timer(unsigned long data)
> >  		(struct ieee80211_sub_if_data *) data;
> >  	struct ieee80211_local *local = sdata->local;
> >  
> > -	if (local->quiescing)
> > +	if (local->quiescing || local->sw_scanning || local->hw_scanning)
> 
> I'd rather have  that check in ieee80211_mgd_probe_ap itself, so it's
> much closer to the source of the problem.

And, incidentally, not racy then.

johannes
Luis Rodriguez July 23, 2009, 11:21 p.m. UTC | #3
On Thu, Jul 23, 2009 at 3:59 PM, Johannes Berg<johannes@sipsolutions.net> wrote:
> On Fri, 2009-07-24 at 00:58 +0200, Johannes Berg wrote:
>
>> > @@ -2187,7 +2187,7 @@ static void ieee80211_sta_bcn_mon_timer(unsigned long data)
>> >             (struct ieee80211_sub_if_data *) data;
>> >     struct ieee80211_local *local = sdata->local;
>> >
>> > -   if (local->quiescing)
>> > +   if (local->quiescing || local->sw_scanning || local->hw_scanning)
>>
>> I'd rather have  that check in ieee80211_mgd_probe_ap itself, so it's
>> much closer to the source of the problem.
>
> And, incidentally, not racy then.

And wouldn't it be even better to just disable the timers before
scanning and re-enabling after scanning?

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 523c0d9..e90992e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2187,7 +2187,7 @@  static void ieee80211_sta_bcn_mon_timer(unsigned long data)
 		(struct ieee80211_sub_if_data *) data;
 	struct ieee80211_local *local = sdata->local;
 
-	if (local->quiescing)
+	if (local->quiescing || local->sw_scanning || local->hw_scanning)
 		return;
 
 	queue_work(sdata->local->hw.workqueue,