linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linville@tuxdriver.com, gregoryx.alagnou@intel.com,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH v3 1/2] cfg80211: fix regulatory restore upon user hints
Date: Fri, 1 Apr 2011 15:22:46 -0700	[thread overview]
Message-ID: <AANLkTi=U0PYmvTmadQu+a5OzoyxKMu_rn0wi=Wq37Spi@mail.gmail.com> (raw)
In-Reply-To: <1301694574.3842.6.camel@jlt3.sipsolutions.net>

On Fri, Apr 1, 2011 at 2:49 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Fri, 2011-04-01 at 14:47 -0700, Luis R. Rodriguez wrote:
>> On Fri, Apr 1, 2011 at 1:28 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
>> > On Fri, 2011-04-01 at 13:10 -0700, Luis R. Rodriguez wrote:
>> >>
>> >> The order should not matter except that we want the queue to be
>> >> cleared before processing core hints when doing restoration, otherwise
>> >> the next user hint in the queue can be bogus and it will prevent a
>> >> restore.
>> >
>> > I'm just thinking this temporary clearing could cause us to reject a
>> > reply from CRDA that's coming in at the same time that is due to a user
>> > request.
>>
>> Ah, I see, hmm well I tested this with:
>>
>> iw reg set US; iw reg set XA; iw reg set XB; iw reg set CR; iw dev
>> wlan0 disconnect; iw reg set FR;
>
> was CRDA running though?

Yes

> If so, it will probably reply right away

Except for the cases that are bogus: XA, XB

> -- I  don't think you can hit the race easily.

I'm just trying to see the entry points on the code for such a race,
apart from the points I mentioned I cannot see any other case. Can
you?

>> and things were still being processed in the order sent. There is a
>> small race between the unlock of the reg_mutex on
>> restore_regulatory_settings() down until where we lock the
>> regulatory_hint_core() and regulatory_hint_user(). The chances of a
>> user regulatory hint coming in between is very low, I could not do it.
>> Then there is also a small race of getting a user reg hint on
>> restore_regulatory_settings() in between the regulatory_hint_user()
>> and the lock of the reg_mutex again for processing old regulatory
>> hints, but the worst that can happen in that case is we squeeze in a
>> user regulatory hint in before the other older regulatory hints, and
>> this is fine.
>>
>> I cannot see any other cases here where we'd block a request from userspace.
>
> No not block a request. I'm just thinking that this taking things off
> the list temporarily might erroneously discard a crda response.

Ah, but the stuff in the queue is stuff which we have not yet sent out
to userspace. CRDA and the kernel process regulatory requests
atomically.

  Luis

  reply	other threads:[~2011-04-01 22:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01 19:42 [PATCH v3 1/2] cfg80211: fix regulatory restore upon user hints Luis R. Rodriguez
2011-04-01 19:59 ` Johannes Berg
2011-04-01 20:10   ` Luis R. Rodriguez
2011-04-01 20:28     ` Johannes Berg
2011-04-01 21:47       ` Luis R. Rodriguez
2011-04-01 21:49         ` Johannes Berg
2011-04-01 22:22           ` Luis R. Rodriguez [this message]
2011-04-04 12:19             ` Johannes Berg
2011-04-04 19:57               ` Luis R. Rodriguez

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='AANLkTi=U0PYmvTmadQu+a5OzoyxKMu_rn0wi=Wq37Spi@mail.gmail.com' \
    --to=lrodriguez@atheros.com \
    --cc=gregoryx.alagnou@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).