linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Luis R. Rodriguez" <lrodriguez@atheros.com>
Cc: Luis Rodriguez <Luis.Rodriguez@Atheros.com>,
	"linville@tuxdriver.com" <linville@tuxdriver.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] cfg80211: add get reg command
Date: Wed, 28 Jan 2009 15:50:34 +0100	[thread overview]
Message-ID: <1233154234.4071.26.camel@johannes.local> (raw)
In-Reply-To: <20090128144455.GE6174@tesla>

[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]

On Wed, 2009-01-28 at 06:44 -0800, Luis R. Rodriguez wrote:
> On Wed, Jan 28, 2009 at 02:17:21AM -0800, Johannes Berg wrote:
> > On Tue, 2009-01-27 at 18:52 -0800, Luis R. Rodriguez wrote:
> > 
> > > +	mutex_lock(&cfg80211_drv_mutex);
> > > +	regd = reg_get_current_rd();
> > > +	mutex_unlock(&cfg80211_drv_mutex);
> > > +
> > > +	if (!regd)
> > > +		goto out;
> > 
> > Any reason you need to copy and can't just build the whole thing under
> > lock?
> 
> Glad you asked, we can lock the entire call or we can do the above to
> copy. I picked a copy to not let a regular user (get reg can be called
> by anyone) abuse the lock as cfg80211_drv_mutex is used in a lot of places,
> I guess its silly but other's input on this is appreciated as well. Not sure
> if the copy was the best choice.

I don't really see much difference between locking to create a copy and
locking to create a copy in a different format, do you? Except to create
a copy needs to allocate memory which could take even longer.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2009-01-28 14:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28  2:52 [PATCH] cfg80211: add get reg command Luis R. Rodriguez
2009-01-28 10:17 ` Johannes Berg
2009-01-28 14:44   ` Luis R. Rodriguez
2009-01-28 14:50     ` Johannes Berg [this message]
2009-01-28 15:20       ` Luis R. Rodriguez
2009-01-28 16:16         ` 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=1233154234.4071.26.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=Luis.Rodriguez@Atheros.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --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 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).