From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
To: Saikiran B <bjsaikiran@gmail.com>
Cc: ath12k@lists.infradead.org, linux-wireless@vger.kernel.org,
kvalo@kernel.org
Subject: Re: [PATCH] wifi: ath12k: Remove broken frequency range filtering
Date: Mon, 26 Jan 2026 14:51:59 +0800 [thread overview]
Message-ID: <ad7a2168-58d8-4afa-8744-84a34a63cd09@oss.qualcomm.com> (raw)
In-Reply-To: <CAAFDt1syi0jLvrho4mnvwsv8HtraT78wP8tCLFHRw3oiTq2E5w@mail.gmail.com>
On 1/26/2026 2:35 PM, Saikiran B wrote:
> Hi Baochen,
>
> Thanks for the review.
>
> regarding ath12k_mac_update_freq_range(): You are correct that this
> function eventually updates the frequency range.
>
> However, on the WCN7850 (Lenovo Yoga Slim 7x), there is a race condition
> during boot/resume. ath12k_reg_update_chan_list() is being executed *before*
> ath12k_regd_update() has finished populating ar->freq_range.
could you please elaborate on the race?
>
> At that specific moment, ar->freq_range.end_freq is still 0. The check: if
> (center_freq > KHZ_TO_MHZ(ar->freq_range.end_freq)) evaluates to true for
> all channels, causing the driver to silently drop every 5GHz channel from
> the scan list.
>
> If I cannot remove this filter entirely, would you accept a V2 that skips
> the filtering if the range is uninitialized?
>
> Example:
>
> /* Skip check if regulatory range hasn't been populated yet */if
> (ar->freq_range.end_freq != 0 &&
> (center_freq < KHZ_TO_MHZ(ar->freq_range.start_freq) ||
> center_freq > KHZ_TO_MHZ(ar->freq_range.end_freq)))
> continue;
>
> Without this change (or something similar), 5GHz is completely unusable on
> this platform.
>
> Thanks & Regards,
> Jaya saikiran
>
> On Mon, Jan 26, 2026 at 11:15 AM Baochen Qiang <
> baochen.qiang@oss.qualcomm.com> wrote:
>
>>
>>
>> On 1/23/2026 11:57 PM, Saikiran wrote:
>>> Between kernel 6.16 and 6.17, ath12k added frequency range filtering in
>>> ath12k_reg_update_chan_list() that filters channels based on
>>> ar->freq_range.start_freq and ar->freq_range.end_freq.
>>>
>>> However, these values are reset to 0 in ath12k_regd_update(), causing
>>
>> Yes, it is reset at the first, but it get re-calculated later. See
>> ath12k_mac_update_freq_range() called in ath12k_regd_update().
>>
>>> the filter to skip ALL channels:
>>> if (channel_freq < 0 || channel_freq > 0) // Always true when
>> end_freq=0
>>> continue; // All channels skipped
>>>
>>> This results in no channel list sent to firmware, causing 5 GHz Wi-Fi
>>> to stop working.
>>>
>>> Fix by removing the broken frequency range filtering. The firmware
>>> itself handles frequency range restrictions based on hardware
>> capabilities.
>>>
>>> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302 (Lenovo Yoga Slim 7x)
>>>
>>> Signed-off-by: Saikiran <bjsaikiran@gmail.com>
>>> ---
>>> drivers/net/wireless/ath/ath12k/reg.c | 13 -------------
>>> 1 file changed, 13 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/ath/ath12k/reg.c
>> b/drivers/net/wireless/ath/ath12k/reg.c
>>> index 2dfcef013277..2d9adc74ac6e 100644
>>> --- a/drivers/net/wireless/ath/ath12k/reg.c
>>> +++ b/drivers/net/wireless/ath/ath12k/reg.c
>>> @@ -153,12 +153,6 @@ int ath12k_reg_update_chan_list(struct ath12k *ar,
>> bool wait)
>>> if (bands[band]->channels[i].flags &
>>> IEEE80211_CHAN_DISABLED)
>>> continue;
>>> - /* Skip Channels that are not in current radio's
>> range */
>>> - if (bands[band]->channels[i].center_freq <
>>> - KHZ_TO_MHZ(ar->freq_range.start_freq) ||
>>> - bands[band]->channels[i].center_freq >
>>> - KHZ_TO_MHZ(ar->freq_range.end_freq))
>>> - continue;
>>>
>>> num_channels++;
>>> }
>>> @@ -190,13 +184,6 @@ int ath12k_reg_update_chan_list(struct ath12k *ar,
>> bool wait)
>>> if (channel->flags & IEEE80211_CHAN_DISABLED)
>>> continue;
>>>
>>> - /* Skip Channels that are not in current radio's
>> range */
>>> - if (bands[band]->channels[i].center_freq <
>>> - KHZ_TO_MHZ(ar->freq_range.start_freq) ||
>>> - bands[band]->channels[i].center_freq >
>>> - KHZ_TO_MHZ(ar->freq_range.end_freq))
>>> - continue;
>>> -
>>> /* TODO: Set to true/false based on some
>> condition? */
>>> ch->allow_ht = true;
>>> ch->allow_vht = true;
>>
>>
>
next prev parent reply other threads:[~2026-01-26 6:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 15:57 [PATCH 0/5] wifi: ath12k: Fix 5 GHz Wi-Fi regression on WCN7850 Saikiran
2026-01-23 15:57 ` [PATCH] wifi: ath12k: Fix firmware stats leak on get_txpower error paths Saikiran
2026-01-26 5:22 ` Baochen Qiang
2026-01-23 15:57 ` [PATCH] wifi: ath12k: Initialize regulatory frequency ranges to avoid filtering all channels Saikiran
2026-01-26 5:26 ` Baochen Qiang
2026-01-23 15:57 ` [PATCH] wifi: ath12k: Add fallback regulatory domain for WCN7850 without SMBIOS Saikiran
2026-01-23 15:57 ` [PATCH] wifi: ath12k: Remove broken frequency range filtering Saikiran
2026-01-26 5:45 ` Baochen Qiang
[not found] ` <CAAFDt1syi0jLvrho4mnvwsv8HtraT78wP8tCLFHRw3oiTq2E5w@mail.gmail.com>
2026-01-26 6:51 ` Baochen Qiang [this message]
[not found] ` <CAAFDt1v-CBHPTMHQB2B9o3X547agCj77RF9tpp_sgUAPkUaYSw@mail.gmail.com>
2026-01-26 8:28 ` Saikiran B
2026-01-23 15:57 ` [PATCH] wifi: ath12k: Fix invalid frequency error in freq_to_idx Saikiran
2026-01-26 3:38 ` Baochen Qiang
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=ad7a2168-58d8-4afa-8744-84a34a63cd09@oss.qualcomm.com \
--to=baochen.qiang@oss.qualcomm.com \
--cc=ath12k@lists.infradead.org \
--cc=bjsaikiran@gmail.com \
--cc=kvalo@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