public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: John Linville <linville@tuxdriver.com>,
	Pavel Roskin <proski@gnu.org>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] mac80211: fix scan channel race
Date: Fri, 8 May 2009 13:24:31 -0700	[thread overview]
Message-ID: <43e72e890905081324k71de0dbbw998e506521b2f721@mail.gmail.com> (raw)
In-Reply-To: <1241698981.27208.8.camel@johannes.local>

On Thu, May 7, 2009 at 5:23 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> When a software scan starts, it first sets sw_scanning, but
> leaves the scan_channel "unset" (it currently actually gets
> initialised to a default). Now, when something else tries
> to (re)configure the hardware in the window between these two
> events (after sw_scanning = true, but before scan_channel is
> set), the current code switches to the (unset!) scan_channel.
> This causes trouble, especially when switching bands and
> sending frames on the wrong channel.
>
> To work around this, leave scan_channel initialised to NULL
> and use it to determine whether or not a switch to a different
> channel should occur (and also use the same condition to check
> whether to adjust power for scan or not).
>
> Additionally, avoid reconfiguring the hardware completely when
> recalculating idle resulted in no changes, this was the problem
> that originally led us to discover the race condition in the
> first place, which was helpfully bisected by Pavel. This part
> of the patch should not be necessary with the other fixes, but
> not calling the ieee80211_hw_config function when we know it to
> be unnecessary is certainly a correct thing to do.
>
> Unfortunately, this patch cannot and does not fix the race
> condition completely, but due to the way the scan code is
> structured it makes the particular problem Pavel discovered
> (race while changing channel at the same time as transmitting
> frames) go away. To fix it completely, more work especially
> with locking configuration is needed.
>
> Bisected-by: Pavel Roskin <proski@gnu.org>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

I've tested this on a dual band card and in fact as I expected it
cured the oops we were seeing with ath9k.

  Luis

  reply	other threads:[~2009-05-08 20:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-07 12:23 [PATCH] mac80211: fix scan channel race Johannes Berg
2009-05-08 20:24 ` Luis R. Rodriguez [this message]
2009-05-08 20:28 ` Pavel Roskin
2009-05-08 20:37   ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43e72e890905081324k71de0dbbw998e506521b2f721@mail.gmail.com \
    --to=mcgrof@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=proski@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox