linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Cavallari <Nicolas.Cavallari@green-communications.fr>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Luca Coelho <luca@coelho.fi>,
	johannes@sipsolutions.net, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 09/13] cfg80211: Save the regulatory domain when setting custom regulatory
Date: Mon, 11 Oct 2021 16:09:15 +0200	[thread overview]
Message-ID: <5a4d958d-6e9a-2a49-314c-8181aaa05ba0@green-communications.fr> (raw)
In-Reply-To: <87ily325t4.fsf@tynnyri.adurom.net>

On 11/10/2021 12:51, Kalle Valo wrote:
> Nicolas Cavallari <Nicolas.Cavallari@green-communications.fr> writes:
> 
>> On 29/11/2020 16:30, Luca Coelho wrote:
>>> From: Ilan Peer <ilan.peer@intel.com>
>>>
>>> When custom regulatory was set, only the channels setting was updated, but
>>> the regulatory domain was not saved. Fix it by saving it.
>>>
>>> Signed-off-by: Ilan Peer <ilan.peer@intel.com>
>>> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
>>> ---
>>>    net/wireless/reg.c | 8 ++++++++
>>>    1 file changed, 8 insertions(+)
>>>
>>> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
>>> index a04fdfb35f07..094492b62f8a 100644
>>> --- a/net/wireless/reg.c
>>> +++ b/net/wireless/reg.c
>>> @@ -2547,6 +2547,7 @@ static void handle_band_custom(struct wiphy *wiphy,
>>>    void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
>>>    				   const struct ieee80211_regdomain *regd)
>>>    {
>>> +	const struct ieee80211_regdomain *new_regd, *tmp;
>>>    	enum nl80211_band band;
>>>    	unsigned int bands_set = 0;
>>>    @@ -2566,6 +2567,13 @@ void wiphy_apply_custom_regulatory(struct
>>> wiphy *wiphy,
>>>    	 * on your device's supported bands.
>>>    	 */
>>>    	WARN_ON(!bands_set);
>>> +	new_regd = reg_copy_regd(regd);
>>> +	if (IS_ERR(new_regd))
>>> +		return;
>>> +
>>> +	tmp = get_wiphy_regdom(wiphy);
>>> +	rcu_assign_pointer(wiphy->regd, new_regd);
>>> +	rcu_free_regdom(tmp);
>>>    }
>>>    EXPORT_SYMBOL(wiphy_apply_custom_regulatory);
>>>    
>>>
>>
>> Hello,
>>
>> This patch somehow appears to break ath9k's eeprom hints and restrict
>> it to the world regulatory domain on v5.12.10.
>>
>> ath9k calls wiphy_apply_custom_regulatory() with its own kind of world
>> regulatory domain, before it decodes hints from the eeprom and uses
>> regulatory_hint() to request a specific alpha2.
>>
>> With this patch, applying the hint fails because wiphy->regd is already set.
>> If i revert this patch, ath9k works again.
> 
> I have lost track, is this regression fixed now or is it sill
> unresolved?

I admit i forgot about it after reverting the patch and haven't tried a new 
kernel with ath9k since then, but from a quick glance, the code hasn't changed. 
I'll try a new kernel tomorrow.

  reply	other threads:[~2021-10-11 14:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29 15:30 [PATCH 00/13] cfg80211/mac80211 patches from our internal tree 2020-11-29 Luca Coelho
2020-11-29 15:30 ` [PATCH 01/13] mac80211: he: remove non-bss-conf fields from bss_conf Luca Coelho
2020-11-29 15:30 ` [PATCH 02/13] cfg80211: initialize rekey_data Luca Coelho
2020-11-29 15:30 ` [PATCH 03/13] mac80211: support MIC error/replay detected counters driver update Luca Coelho
2020-11-29 15:30 ` [PATCH 04/13] cfg80211: Parse SAE H2E only membership selector Luca Coelho
2020-11-29 15:30 ` [PATCH 05/13] mac80211: Skip entries with " Luca Coelho
2020-11-29 15:30 ` [PATCH 06/13] cfg80211: scan PSC channels in case of scan with wildcard SSID Luca Coelho
2020-11-29 15:30 ` [PATCH 07/13] cfg80211: Update TSF and TSF BSSID for multi BSS Luca Coelho
2020-11-29 15:30 ` [PATCH 08/13] nl80211: always accept scan request with the duration set Luca Coelho
2020-11-29 15:30 ` [PATCH 09/13] cfg80211: Save the regulatory domain when setting custom regulatory Luca Coelho
     [not found]   ` <CGME20201216102006eucas1p18cede9af63b9ad4aed211ecf47c9aa8f@eucas1p1.samsung.com>
2020-12-16 10:20     ` Marek Szyprowski
2020-12-17 13:25       ` Luca Coelho
2021-06-15 14:42   ` Nicolas Cavallari
2021-10-11 10:51     ` Kalle Valo
2021-10-11 14:09       ` Nicolas Cavallari [this message]
2021-10-12 10:24       ` Nicolas Cavallari
2022-02-03 22:30         ` Johannes Berg
2022-02-07 17:56           ` Nicolas Cavallari
2020-11-29 15:30 ` [PATCH 10/13] ieee80211: update reduced neighbor report TBTT info length Luca Coelho
2020-11-29 15:30 ` [PATCH 11/13] mac80211: set sdata state once vif is up after restart Luca Coelho
2020-11-29 15:30 ` [PATCH 12/13] mac80211: disallow band-switch during CSA Luca Coelho
2020-11-29 15:30 ` [PATCH 13/13] cfg80211: include block-tx flag in channel switch started event Luca Coelho

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=5a4d958d-6e9a-2a49-314c-8181aaa05ba0@green-communications.fr \
    --to=nicolas.cavallari@green-communications.fr \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luca@coelho.fi \
    /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).