linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wireless: core: Reorder wiphy_register() notifications relevantly
@ 2014-08-13 13:04 Tomasz Bursztyka
  2014-08-15 13:03 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Tomasz Bursztyka @ 2014-08-13 13:04 UTC (permalink / raw)
  To: linux-wireless; +Cc: Tomasz Bursztyka

Currently it can send regulatory domain change notification before any
NEW_WIPHY notification. Moreover, if rfill_register() fails, calling
wiphy_unregister() will send a DEL_WIPHY though no NEW_WIPHY had been
sent previously.

Thus reordering so it properly notifies NEW_WIPHY before any other.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
---
 net/wireless/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/wireless/core.c b/net/wireless/core.c
index afee5e0..682babd 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -635,6 +635,9 @@ int wiphy_register(struct wiphy *wiphy)
 	if (IS_ERR(rdev->wiphy.debugfsdir))
 		rdev->wiphy.debugfsdir = NULL;
 
+	cfg80211_debugfs_rdev_add(rdev);
+	nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
+
 	if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) {
 		struct regulatory_request request;
 
@@ -646,8 +649,6 @@ int wiphy_register(struct wiphy *wiphy)
 		nl80211_send_reg_change_event(&request);
 	}
 
-	cfg80211_debugfs_rdev_add(rdev);
-
 	rdev->wiphy.registered = true;
 	rtnl_unlock();
 
@@ -659,8 +660,6 @@ int wiphy_register(struct wiphy *wiphy)
 		return res;
 	}
 
-	nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
-
 	return 0;
 }
 EXPORT_SYMBOL(wiphy_register);
-- 
1.8.5.5


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

* Re: [PATCH] wireless: core: Reorder wiphy_register() notifications relevantly
  2014-08-13 13:04 [PATCH] wireless: core: Reorder wiphy_register() notifications relevantly Tomasz Bursztyka
@ 2014-08-15 13:03 ` Johannes Berg
  2014-08-18  7:23   ` Tomasz Bursztyka
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2014-08-15 13:03 UTC (permalink / raw)
  To: Tomasz Bursztyka; +Cc: linux-wireless

Subject should say cfg80211.

On Wed, 2014-08-13 at 16:04 +0300, Tomasz Bursztyka wrote:
> Currently it can send regulatory domain change notification before any
> NEW_WIPHY notification. Moreover, if rfill_register() fails, calling
> wiphy_unregister() will send a DEL_WIPHY though no NEW_WIPHY had been
> sent previously.
> 
> Thus reordering so it properly notifies NEW_WIPHY before any other.

This also isn't actually true - now rfkill is *after* NEW_WIPHY.

This code had a bunch of sequencing issues in the past - please look
through the history and check that this doesn't re-introduce any of
them.

johannes


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

* Re: [PATCH] wireless: core: Reorder wiphy_register() notifications relevantly
  2014-08-15 13:03 ` Johannes Berg
@ 2014-08-18  7:23   ` Tomasz Bursztyka
  0 siblings, 0 replies; 3+ messages in thread
From: Tomasz Bursztyka @ 2014-08-18  7:23 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Hi Johannes,

> Subject should say cfg80211.

Ok

>> >Currently it can send regulatory domain change notification before any
>> >NEW_WIPHY notification. Moreover, if rfill_register() fails, calling
>> >wiphy_unregister() will send a DEL_WIPHY though no NEW_WIPHY had been
>> >sent previously.
>> >
>> >Thus reordering so it properly notifies NEW_WIPHY before any other.
> This also isn't actually true - now rfkill is*after*  NEW_WIPHY.

I will prepare another patch.

> This code had a bunch of sequencing issues in the past - please look
> through the history and check that this doesn't re-introduce any of
> them.

Sure

Tomasz

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

end of thread, other threads:[~2014-08-18  7:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-13 13:04 [PATCH] wireless: core: Reorder wiphy_register() notifications relevantly Tomasz Bursztyka
2014-08-15 13:03 ` Johannes Berg
2014-08-18  7:23   ` Tomasz Bursztyka

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).