mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Daniel Berlin <dberlin@dberlin.org>,
	Arend van Spriel <aspriel@gmail.com>,
	Franky Lin <franky.lin@broadcom.com>,
	Hante Meuleman <hante.meuleman@broadcom.com>
Cc: linux-wireless@vger.kernel.org,
	brcm80211-dev-list.pdl@broadcom.com,
	SHA-cyfmac-dev-list@infineon.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] [brcmfmac] Fix regulatory domain handling to reset bands properly
Date: Mon, 23 Oct 2023 10:37:57 +0200	[thread overview]
Message-ID: <bfe4ee3e-a136-a7ed-5fcd-0377c9f35726@broadcom.com> (raw)
In-Reply-To: <CAF4BwTVQf25uCCVovtce+kjz0pFFMZX=Ln36R4Vd-1LEsxrcMw@mail.gmail.com>

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

On 10/21/2023 4:40 PM, Daniel Berlin wrote:
> As an aside, the alternative would be to simply not ignore any
> attempts to set the regulatory domain, regardless of whether it's 00
> or the chip is already set to that country.
> It doesn't happen that often, so it's not clear it's worth avoiding it at all.
> There are some things i'd have to fix to make it work resiliently well
> (for example, i know we set the 2g bw cap where we do because it has
> to be done with the interface down), but i can fix those if needed.

Please do not top post.

The firmware has its own regulatory information (actually the CLM blob 
holds that information) which is independent of the wireless regulatory 
database in the kernel. As such trying to configure country '00' will 
simply fail as it is not known inside CLM blob. The firmware needs a 
country abbreviation *and* a revision. Hence we require a mapping of 
country code to <abbrev,rev> tuple. If that mapping is not in place we 
bail out setting the country in the regulatory notifier.

 From the description below it is not clear what problem is fixed here 
in terms of user experience.

Regards,
Arend

> On Thu, Oct 19, 2023 at 10:18 AM Daniel Berlin <dberlin@dberlin.org> wrote:
>>
>> Currently, we ignore the default country in the reg notifier.
>> We also register a custom regulatory domain, which is set
>> as the default.
>> As a result, the chip is likely to be set to the correct country,
>> but the regulatory domain will not match it.
>>
>> When the regulatory notifier is then called, we see the countries
>> are the same and do not change anything, even though the domain
>> is wrong.
>>
>> This patch forces us to reset the bands on the first country change
>> even if the chip is already set to that country.
>>
>> We also restore the original band info before reconstructing channel
>> info, as the new regdom power limits may be higher than what is
>> currently set.
>>
>> Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
>> ---
>>   .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 38 +++++++++++++++----
>>   .../broadcom/brcm80211/brcmfmac/cfg80211.h    |  2 +
>>   2 files changed, 33 insertions(+), 7 deletions(-)

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4219 bytes --]

  reply	other threads:[~2023-10-23  8:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1697719099.git.dberlin@dberlin.org>
     [not found] ` <d2ef482bcf01fc515224cd508d730590a5294df2.1697719099.git.dberlin@dberlin.org>
2023-10-21 14:40   ` Daniel Berlin
2023-10-23  8:37     ` Arend van Spriel [this message]
2023-10-23 11:34       ` Daniel Berlin

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=bfe4ee3e-a136-a7ed-5fcd-0377c9f35726@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=SHA-cyfmac-dev-list@infineon.com \
    --cc=aspriel@gmail.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=dberlin@dberlin.org \
    --cc=franky.lin@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®