linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Wey-Yi Guy <wey-yi.w.guy@intel.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH 4/6] mac80211: assure we also cancel deferred scan request
Date: Mon, 4 Oct 2010 17:17:00 +0200	[thread overview]
Message-ID: <20101004151659.GB16478@redhat.com> (raw)
In-Reply-To: <1286197861.3620.31.camel@jlt3.sipsolutions.net>

On Mon, Oct 04, 2010 at 03:11:01PM +0200, Johannes Berg wrote:
> On Fri, 2010-10-01 at 14:05 +0200, Stanislaw Gruszka wrote:
> > When cfg80211 request the scan and mac80211 perform some management work,
> > we defer the scan request. We do not canceling such requests when calling
> > ieee80211_scan_cancel(), because of SCAN_SW_SCANNING bit check just
> > before the call. So fix that problem. Keeping local->mtx lock assures
> > that the deferred scan will not become "working" HW scan.
> 
> But don't we also delay it becoming a working scan while we have work
> pending? Which seems OK?

Yes, you have right, we cancel the scan_work before that, so transition
will not happen.

> Also what's with all the other changes here, they don't seem related to
> this?

This change

        mutex_lock(&local->mtx);
        if (test_bit(SCAN_SW_SCANNING, &local->scanning) ||
-           (!local->scanning && local->scan_req))
+           (!test_bit(SCAN_HW_SCANNING, &local->scanning) && local->scan_req))
                finish = __ieee80211_scan_completed(&local->hw, true, false);
        mutex_unlock(&local->mtx);


is for ignore local->scanning bits, in case we have some bits set up but no
hw scanning is pending. Not sure If this fix some real problem, but
make things safer IMHO.

We have to think here about hw, sw and deferred scan. Canceling scan_work
seems to wrong for hw_scan, but we still have to remember about sw scan and
deferred scan ... I will try to rewrite patch to cope with all cases.

Stanislaw

  reply	other threads:[~2010-10-04 15:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-01 12:05 [PATCH 1/6] mac80211: perform scan cancel in hw reset work Stanislaw Gruszka
2010-10-01 12:05 ` [PATCH 2/6] mac80211: merge ieee80211_scan_work() common code Stanislaw Gruszka
2010-10-04 13:02   ` Johannes Berg
2010-10-04 13:07   ` Johannes Berg
2010-10-01 12:05 ` [PATCH 3/6] mac80211: keep lock when calling __ieee80211_scan_completed() Stanislaw Gruszka
2010-10-04 13:09   ` Johannes Berg
2010-10-04 14:52     ` Stanislaw Gruszka
2010-10-01 12:05 ` [PATCH 4/6] mac80211: assure we also cancel deferred scan request Stanislaw Gruszka
2010-10-04 13:11   ` Johannes Berg
2010-10-04 15:17     ` Stanislaw Gruszka [this message]
2010-10-01 12:05 ` [PATCH 5/6] mac80211: do not requeue scan work when not needed Stanislaw Gruszka
2010-10-01 12:05 ` [PATCH 6/6] Revert "iwlwifi: do not perferm force reset while doing scan" Stanislaw Gruszka
2010-10-01 16:11 ` [PATCH 1/6] mac80211: perform scan cancel in hw reset work Johannes Berg
2010-10-01 17:20   ` Luis R. Rodriguez
2010-10-05  9:25     ` Stanislaw Gruszka

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=20101004151659.GB16478@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=wey-yi.w.guy@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).