From: Miri Korenblit miriam.rachel.korenblit@intel.com
commit 1b7b3ac8ff3317cdcf07a1c413de9bdb68019c2b upstream.
We used to set regulatory info before the registration of the device and then the regulatory info didn't get set, because the device isn't registered so there isn't a device to set the regulatory info for. So set the regulatory info after the device registration. Call reg_process_self_managed_hints() once again after the device registration because it does nothing before it.
Signed-off-by: Miri Korenblit miriam.rachel.korenblit@intel.com Signed-off-by: Luca Coelho luciano.coelho@intel.com Link: https://lore.kernel.org/r/iwlwifi.20210618133832.c96eadcffe80.I86799c2c866b5... Signed-off-by: Johannes Berg johannes.berg@intel.com --- net/wireless/core.c | 7 ++++--- net/wireless/reg.c | 1 + 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/wireless/core.c b/net/wireless/core.c index 68660781aa51..7c66f99046ac 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -4,6 +4,7 @@ * Copyright 2006-2010 Johannes Berg johannes@sipsolutions.net * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2015-2017 Intel Deutschland GmbH + * Copyright (C) 2018-2021 Intel Corporation */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -835,9 +836,6 @@ int wiphy_register(struct wiphy *wiphy) return res; }
- /* set up regulatory info */ - wiphy_regulatory_register(wiphy); - list_add_rcu(&rdev->list, &cfg80211_rdev_list); cfg80211_rdev_list_generation++;
@@ -851,6 +849,9 @@ int wiphy_register(struct wiphy *wiphy) cfg80211_debugfs_rdev_add(rdev); nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
+ /* set up regulatory info */ + wiphy_regulatory_register(wiphy); + if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) { struct regulatory_request request;
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index c7825b951f72..dd8503a3ef1e 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -3756,6 +3756,7 @@ void wiphy_regulatory_register(struct wiphy *wiphy)
wiphy_update_regulatory(wiphy, lr->initiator); wiphy_all_share_dfs_chan_state(wiphy); + reg_process_self_managed_hints(); }
void wiphy_regulatory_deregister(struct wiphy *wiphy)
On Fri, May 27, 2022 at 11:11:51AM +0200, Johannes Berg wrote:
From: Miri Korenblit miriam.rachel.korenblit@intel.com
commit 1b7b3ac8ff3317cdcf07a1c413de9bdb68019c2b upstream.
We used to set regulatory info before the registration of the device and then the regulatory info didn't get set, because the device isn't registered so there isn't a device to set the regulatory info for. So set the regulatory info after the device registration. Call reg_process_self_managed_hints() once again after the device registration because it does nothing before it.
Signed-off-by: Miri Korenblit miriam.rachel.korenblit@intel.com Signed-off-by: Luca Coelho luciano.coelho@intel.com Link: https://lore.kernel.org/r/iwlwifi.20210618133832.c96eadcffe80.I86799c2c866b5... Signed-off-by: Johannes Berg johannes.berg@intel.com
net/wireless/core.c | 7 ++++--- net/wireless/reg.c | 1 + 2 files changed, 5 insertions(+), 3 deletions(-)
What about versions for 5.4.y and 5.10.y as well? We can't just fix an issue in an older kernel tree and ignore it in newer ones, right?
thanks,
greg k-h
On Fri, 2022-05-27 at 18:08 +0200, Greg KH wrote:
On Fri, May 27, 2022 at 11:11:51AM +0200, Johannes Berg wrote:
From: Miri Korenblit miriam.rachel.korenblit@intel.com
commit 1b7b3ac8ff3317cdcf07a1c413de9bdb68019c2b upstream.
We used to set regulatory info before the registration of the device and then the regulatory info didn't get set, because the device isn't registered so there isn't a device to set the regulatory info for. So set the regulatory info after the device registration. Call reg_process_self_managed_hints() once again after the device registration because it does nothing before it.
Signed-off-by: Miri Korenblit miriam.rachel.korenblit@intel.com Signed-off-by: Luca Coelho luciano.coelho@intel.com Link: https://lore.kernel.org/r/iwlwifi.20210618133832.c96eadcffe80.I86799c2c866b5... Signed-off-by: Johannes Berg johannes.berg@intel.com
net/wireless/core.c | 7 ++++--- net/wireless/reg.c | 1 + 2 files changed, 5 insertions(+), 3 deletions(-)
What about versions for 5.4.y and 5.10.y as well? We can't just fix an issue in an older kernel tree and ignore it in newer ones, right?
Huh, good point. I hadn't checked, people complained about it on 4.19.
johannes
On Fri, May 27, 2022 at 06:17:59PM +0200, Johannes Berg wrote:
On Fri, 2022-05-27 at 18:08 +0200, Greg KH wrote:
On Fri, May 27, 2022 at 11:11:51AM +0200, Johannes Berg wrote:
From: Miri Korenblit miriam.rachel.korenblit@intel.com
commit 1b7b3ac8ff3317cdcf07a1c413de9bdb68019c2b upstream.
We used to set regulatory info before the registration of the device and then the regulatory info didn't get set, because the device isn't registered so there isn't a device to set the regulatory info for. So set the regulatory info after the device registration. Call reg_process_self_managed_hints() once again after the device registration because it does nothing before it.
Signed-off-by: Miri Korenblit miriam.rachel.korenblit@intel.com Signed-off-by: Luca Coelho luciano.coelho@intel.com Link: https://lore.kernel.org/r/iwlwifi.20210618133832.c96eadcffe80.I86799c2c866b5... Signed-off-by: Johannes Berg johannes.berg@intel.com
net/wireless/core.c | 7 ++++--- net/wireless/reg.c | 1 + 2 files changed, 5 insertions(+), 3 deletions(-)
What about versions for 5.4.y and 5.10.y as well? We can't just fix an issue in an older kernel tree and ignore it in newer ones, right?
Huh, good point. I hadn't checked, people complained about it on 4.19.
All now queued up, thanks.
greg k-h
linux-stable-mirror@lists.linaro.org