Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register
@ 2013-07-21 13:36 Arik Nemtsov
  2013-07-21 13:36 ` [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout Arik Nemtsov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Arik Nemtsov @ 2013-07-21 13:36 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Luis R. Rodriguez, Arik Nemtsov

The current regdomain was not always set by the core. This causes
cards with a custom regulatory domain to ignore user initiated changes
if done before the card was registered.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 net/wireless/reg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index ddeff80..1ec3933 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2250,10 +2250,13 @@ int reg_device_uevent(struct device *dev, struct kobj_uevent_env *env)
 
 void wiphy_regulatory_register(struct wiphy *wiphy)
 {
+	struct regulatory_request *lr;
+
 	if (!reg_dev_ignore_cell_hint(wiphy))
 		reg_num_devs_support_basehint++;
 
-	wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
+	lr = get_last_request();
+	wiphy_update_regulatory(wiphy, lr->initiator);
 }
 
 void wiphy_regulatory_deregister(struct wiphy *wiphy)
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout
  2013-07-21 13:36 [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register Arik Nemtsov
@ 2013-07-21 13:36 ` Arik Nemtsov
  2013-07-21 14:10   ` Sujith Manoharan
  2013-07-23 18:21 ` [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register Luis R. Rodriguez
  2013-07-25  7:53 ` Johannes Berg
  2 siblings, 1 reply; 6+ messages in thread
From: Arik Nemtsov @ 2013-07-21 13:36 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Luis R. Rodriguez, Arik Nemtsov

The RTNL has to be held since this potentially changes the regdomain.
Locking was forgotten here due to recent locking simplification changes.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 net/wireless/reg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 1ec3933..b25390a 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2285,7 +2285,9 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy)
 static void reg_timeout_work(struct work_struct *work)
 {
 	REG_DBG_PRINT("Timeout while waiting for CRDA to reply, restoring regulatory settings\n");
+	rtnl_lock();
 	restore_regulatory_settings(true);
+	rtnl_unlock();
 }
 
 int __init regulatory_init(void)
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout
  2013-07-21 13:36 ` [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout Arik Nemtsov
@ 2013-07-21 14:10   ` Sujith Manoharan
  2013-07-21 14:18     ` Arik Nemtsov
  0 siblings, 1 reply; 6+ messages in thread
From: Sujith Manoharan @ 2013-07-21 14:10 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless, Johannes Berg, Luis R. Rodriguez

Arik Nemtsov wrote:
> The RTNL has to be held since this potentially changes the regdomain.
> Locking was forgotten here due to recent locking simplification changes.

This is already present in the mac80211 tree:
https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/commit/?id=f77b86d7d3acf9dfcb5ee834628d12207584b2cb

Sujith

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout
  2013-07-21 14:10   ` Sujith Manoharan
@ 2013-07-21 14:18     ` Arik Nemtsov
  0 siblings, 0 replies; 6+ messages in thread
From: Arik Nemtsov @ 2013-07-21 14:18 UTC (permalink / raw)
  To: Sujith Manoharan; +Cc: linux-wireless, Johannes Berg, Luis R. Rodriguez

On Sun, Jul 21, 2013 at 5:10 PM, Sujith Manoharan <sujith@msujith.org> wrote:
> Arik Nemtsov wrote:
>> The RTNL has to be held since this potentially changes the regdomain.
>> Locking was forgotten here due to recent locking simplification changes.
>
> This is already present in the mac80211 tree:
> https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/commit/?id=f77b86d7d3acf9dfcb5ee834628d12207584b2cb
>

Ah thanks. I missed that. Disregard then please.

Arik

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register
  2013-07-21 13:36 [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register Arik Nemtsov
  2013-07-21 13:36 ` [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout Arik Nemtsov
@ 2013-07-23 18:21 ` Luis R. Rodriguez
  2013-07-25  7:53 ` Johannes Berg
  2 siblings, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2013-07-23 18:21 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless, Johannes Berg

On Sun, Jul 21, 2013 at 6:36 AM, Arik Nemtsov <arik@wizery.com> wrote:
> The current regdomain was not always set by the core. This causes
> cards with a custom regulatory domain to ignore user initiated changes
> if done before the card was registered.
>
> Signed-off-by: Arik Nemtsov <arik@wizery.com>

Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>

  Luis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register
  2013-07-21 13:36 [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register Arik Nemtsov
  2013-07-21 13:36 ` [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout Arik Nemtsov
  2013-07-23 18:21 ` [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register Luis R. Rodriguez
@ 2013-07-25  7:53 ` Johannes Berg
  2 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2013-07-25  7:53 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless, Luis R. Rodriguez

On Sun, 2013-07-21 at 16:36 +0300, Arik Nemtsov wrote:
> The current regdomain was not always set by the core. This causes
> cards with a custom regulatory domain to ignore user initiated changes
> if done before the card was registered.

Applied, thanks.

johannes


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-25  7:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-21 13:36 [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register Arik Nemtsov
2013-07-21 13:36 ` [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout Arik Nemtsov
2013-07-21 14:10   ` Sujith Manoharan
2013-07-21 14:18     ` Arik Nemtsov
2013-07-23 18:21 ` [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register Luis R. Rodriguez
2013-07-25  7:53 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox