All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Sven Eckelmann <sven@narfation.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	Sven Eckelmann <sven@narfation.org>
Subject: Re: [PATCH] ath11k: Fix ETSI regd with weather radar overlap
Date: Wed, 17 Nov 2021 07:27:37 +0000 (UTC)	[thread overview]
Message-ID: <163713405345.31320.10844437499755849817.kvalo@codeaurora.org> (raw)
In-Reply-To: <20211112153116.1214421-1-sven@narfation.org>

Sven Eckelmann <sven@narfation.org> wrote:

> Some ETSI countries have a small overlap in the wireless-regdb with an ETSI
> channel (5590-5650). A good example is Australia:
> 
>   country AU: DFS-ETSI
>         (2400 - 2483.5 @ 40), (36)
>         (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW
>         (5250 - 5350 @ 80), (20), NO-OUTDOOR, AUTO-BW, DFS
>         (5470 - 5600 @ 80), (27), DFS
>         (5650 - 5730 @ 80), (27), DFS
>         (5730 - 5850 @ 80), (36)
>         (57000 - 66000 @ 2160), (43), NO-OUTDOOR
> 
> If the firmware (or the BDF) is shipped with these rules then there is only
> a 10 MHz overlap with the weather radar:
> 
> * below: 5470 - 5590
> * weather radar: 5590 - 5600
> * above: (none for the rule "5470 - 5600 @ 80")
> 
> There are several wrong assumption in the ath11k code:
> 
> * there is always a valid range below the weather radar
>   (actually: there could be no range below the weather radar range OR range
>    could be smaller than 20 MHz)
> * intersected range in the weather radar range is valid
>   (actually: the range could be smaller than 20 MHz)
> * range above weather radar is either empty or valid
>   (actually: the range could be smaller than 20 MHz)
> 
> These wrong assumption will lead in this example to a rule
> 
>   (5590 - 5600 @ 20), (N/A, 27), (600000 ms), DFS, AUTO-BW
> 
> which is invalid according to is_valid_reg_rule() because the freq_diff is
> only 10 MHz but the max_bandwidth is set to 20 MHz. Which results in a
> rejection like:
> 
>   WARNING: at backports-20210222_001-4.4.60-b157d2276/net/wireless/reg.c:3984
>   [...]
>   Call trace:
>   [<ffffffbffc3d2e50>] reg_get_max_bandwidth+0x300/0x3a8 [cfg80211]
>   [<ffffffbffc3d3d0c>] regulatory_set_wiphy_regd_sync+0x3c/0x98 [cfg80211]
>   [<ffffffbffc651598>] ath11k_regd_update+0x1a8/0x210 [ath11k]
>   [<ffffffbffc652108>] ath11k_regd_update_work+0x18/0x20 [ath11k]
>   [<ffffffc0000a93e0>] process_one_work+0x1f8/0x340
>   [<ffffffc0000a9784>] worker_thread+0x25c/0x448
>   [<ffffffc0000aedc8>] kthread+0xd0/0xd8
>   [<ffffffc000085550>] ret_from_fork+0x10/0x40
>   ath11k c000000.wifi: failed to perform regd update : -22
>   Invalid regulatory domain detected
> 
> To avoid this, the algorithm has to be changed slightly. Instead of
> splitting a rule which overlaps with the weather radar range into 3 pieces
> and accepting the first two parts blindly, it must actually be checked for
> each piece whether it is a valid range. And only if it is valid, add it to
> the output array.
> 
> When these checks are in place, the processed rules for AU would end up as
> 
>   country AU: DFS-ETSI
>           (2400 - 2483 @ 40), (N/A, 36), (N/A)
>           (5150 - 5250 @ 80), (6, 23), (N/A), NO-OUTDOOR, AUTO-BW
>           (5250 - 5350 @ 80), (6, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
>           (5470 - 5590 @ 80), (6, 27), (0 ms), DFS, AUTO-BW
>           (5650 - 5730 @ 80), (6, 27), (0 ms), DFS, AUTO-BW
>           (5730 - 5850 @ 80), (6, 36), (N/A), AUTO-BW
> 
> and will be accepted by the wireless regulatory code.
> 
> Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

086c921a3540 ath11k: Fix ETSI regd with weather radar overlap

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211112153116.1214421-1-sven@narfation.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@codeaurora.org>
To: Sven Eckelmann <sven@narfation.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	Sven Eckelmann <sven@narfation.org>
Subject: Re: [PATCH] ath11k: Fix ETSI regd with weather radar overlap
Date: Wed, 17 Nov 2021 07:27:37 +0000 (UTC)	[thread overview]
Message-ID: <163713405345.31320.10844437499755849817.kvalo@codeaurora.org> (raw)
In-Reply-To: <20211112153116.1214421-1-sven@narfation.org>

Sven Eckelmann <sven@narfation.org> wrote:

> Some ETSI countries have a small overlap in the wireless-regdb with an ETSI
> channel (5590-5650). A good example is Australia:
> 
>   country AU: DFS-ETSI
>         (2400 - 2483.5 @ 40), (36)
>         (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW
>         (5250 - 5350 @ 80), (20), NO-OUTDOOR, AUTO-BW, DFS
>         (5470 - 5600 @ 80), (27), DFS
>         (5650 - 5730 @ 80), (27), DFS
>         (5730 - 5850 @ 80), (36)
>         (57000 - 66000 @ 2160), (43), NO-OUTDOOR
> 
> If the firmware (or the BDF) is shipped with these rules then there is only
> a 10 MHz overlap with the weather radar:
> 
> * below: 5470 - 5590
> * weather radar: 5590 - 5600
> * above: (none for the rule "5470 - 5600 @ 80")
> 
> There are several wrong assumption in the ath11k code:
> 
> * there is always a valid range below the weather radar
>   (actually: there could be no range below the weather radar range OR range
>    could be smaller than 20 MHz)
> * intersected range in the weather radar range is valid
>   (actually: the range could be smaller than 20 MHz)
> * range above weather radar is either empty or valid
>   (actually: the range could be smaller than 20 MHz)
> 
> These wrong assumption will lead in this example to a rule
> 
>   (5590 - 5600 @ 20), (N/A, 27), (600000 ms), DFS, AUTO-BW
> 
> which is invalid according to is_valid_reg_rule() because the freq_diff is
> only 10 MHz but the max_bandwidth is set to 20 MHz. Which results in a
> rejection like:
> 
>   WARNING: at backports-20210222_001-4.4.60-b157d2276/net/wireless/reg.c:3984
>   [...]
>   Call trace:
>   [<ffffffbffc3d2e50>] reg_get_max_bandwidth+0x300/0x3a8 [cfg80211]
>   [<ffffffbffc3d3d0c>] regulatory_set_wiphy_regd_sync+0x3c/0x98 [cfg80211]
>   [<ffffffbffc651598>] ath11k_regd_update+0x1a8/0x210 [ath11k]
>   [<ffffffbffc652108>] ath11k_regd_update_work+0x18/0x20 [ath11k]
>   [<ffffffc0000a93e0>] process_one_work+0x1f8/0x340
>   [<ffffffc0000a9784>] worker_thread+0x25c/0x448
>   [<ffffffc0000aedc8>] kthread+0xd0/0xd8
>   [<ffffffc000085550>] ret_from_fork+0x10/0x40
>   ath11k c000000.wifi: failed to perform regd update : -22
>   Invalid regulatory domain detected
> 
> To avoid this, the algorithm has to be changed slightly. Instead of
> splitting a rule which overlaps with the weather radar range into 3 pieces
> and accepting the first two parts blindly, it must actually be checked for
> each piece whether it is a valid range. And only if it is valid, add it to
> the output array.
> 
> When these checks are in place, the processed rules for AU would end up as
> 
>   country AU: DFS-ETSI
>           (2400 - 2483 @ 40), (N/A, 36), (N/A)
>           (5150 - 5250 @ 80), (6, 23), (N/A), NO-OUTDOOR, AUTO-BW
>           (5250 - 5350 @ 80), (6, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
>           (5470 - 5590 @ 80), (6, 27), (0 ms), DFS, AUTO-BW
>           (5650 - 5730 @ 80), (6, 27), (0 ms), DFS, AUTO-BW
>           (5730 - 5850 @ 80), (6, 36), (N/A), AUTO-BW
> 
> and will be accepted by the wireless regulatory code.
> 
> Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

086c921a3540 ath11k: Fix ETSI regd with weather radar overlap

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211112153116.1214421-1-sven@narfation.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  reply	other threads:[~2021-11-17  7:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 15:31 [PATCH] ath11k: Fix ETSI regd with weather radar overlap Sven Eckelmann
2021-11-12 15:31 ` Sven Eckelmann
2021-11-17  7:27 ` Kalle Valo [this message]
2021-11-17  7:27   ` Kalle Valo

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=163713405345.31320.10844437499755849817.kvalo@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sven@narfation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.