From: Helmut Schaa <helmut.schaa@googlemail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
"Luis R. Rodriguez" <lrodriguez@atheros.com>
Subject: Re: [RFC] cfg80211: Make NL80211_CMD_SET_REG synchronous
Date: Tue, 7 Dec 2010 11:27:55 +0100 [thread overview]
Message-ID: <201012071127.55852.helmut.schaa@googlemail.com> (raw)
In-Reply-To: <1291715582.3607.10.camel@jlt3.sipsolutions.net>
Am Dienstag, 7. Dezember 2010 schrieb Johannes Berg:
> On Tue, 2010-12-07 at 10:45 +0100, Helmut Schaa wrote:
> > A user space caller of NL80211_CMD_SET_REG previously had no chance to
> > verify if the regulatory domain change it requested already happened.
> > Listening to NL80211_CMD_REG_CHANGE is not enough since it won't be
> > triggered when the regulatory domain didn't change (for example because
> > it was already the same before).
> >
> > Fix this by making NL80211_CMD_SET_REG synchronous by adding a
> > completion struct to the regulatory_hint_user function and wait for the
> > completion of the regulatory request before returning.
>
> Way too complicated. regulatory_hint_user() is called in a context that
> can sleep, obviously, so you can just make it call something like
> run_regulatory_request() that will cancel_work_sync(reg_work) and call
> reg_todo() after queueing, instead of schedule_work(reg_work) -- that
> way when it returns all things have been processed.
Sounds good, but that would also change the other calls to regulatory_hint_user
(regulatory_init & restore_regulatory_settings), not just the netlink command
from user space. Not sure if it is reasoable to wait for these callers as well?
Second, since reg_process_pending_hints and reg_process_pending_hints are mutex
protected we wouldn't even have to to call cancel_work_sync to ensure
serialization.
Helmut
prev parent reply other threads:[~2010-12-07 10:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-07 9:45 [RFC] cfg80211: Make NL80211_CMD_SET_REG synchronous Helmut Schaa
2010-12-07 9:53 ` Johannes Berg
2010-12-07 10:27 ` Helmut Schaa [this message]
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=201012071127.55852.helmut.schaa@googlemail.com \
--to=helmut.schaa@googlemail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=lrodriguez@atheros.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.