[PATCH ath-next 0/4] wifi: ath12k: fix timeout while waiting for regulatory update on bring-up - #1824
Open
Hangtian Zhu (zhuhangtian) wants to merge 4 commits into
Open
Hangtian Zhu (zhuhangtian) wants to merge 4 commits into
Hangtian Zhu (zhuhangtian) wants to merge 4 commits into
Conversation
qcomlnxci
requested review from
a team and
miaoqing-quic
and removed request for
a team
September 15, 2026 02:29
added 4 commits
September 15, 2026 10:31
…is dropped During driver bring-up, ath12k_mac_hw_register() reinitializes ar->regd_update_completed and sends a set current country command to firmware. It then relies on the regulatory event from firmware to signal that completion via ath12k_reg_chan_list_event(). However, when the country being set is identical to the one already applied at boot time, ath12k_reg_validate_reg_info() returns ATH12K_REG_STATUS_DROP through the "Avoid multiple overwrites to default regd" path. In that case ath12k_reg_chan_list_event() jumps to mem_free before assigning pdev_idx, so pdev_idx stays at its initial value of 255, 'ar' remains NULL and complete_all() is never called. As a result the reinitialized completion is left unsignalled and the next ath12k_regd_update() waits the full timeout, printing: Timeout while waiting for regulatory update Fix this by assigning pdev_idx from the event's phy_id right after it is extracted, before validation, so that the drop and fallback paths still reach complete_all(). Change the guard at the end to check the index against ab->num_radios so that an out-of-range phy_id does not lead to an invalid pdevs[] access. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Fixes: 906619a ("wifi: ath12k: handle regulatory hints during mac registration") Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Link: https://patch.msgid.link/20260729-ath12k-regd-wait-timeout-v1-1-504aa6e7e93c@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
In ath12k_mac_hw_register() the local 'ab' is fetched once from the first radio, i.e. ath12k_ah_to_ar(ah, 0)->ab. When an ath12k_hw spans more than one ath12k_base, the radios walked by for_each_ar() may belong to different ath12k_base instances. Using the function-scope 'ab' inside that loop then refers to the first radio's device, which is stale with respect to the ar being processed. This is not a functional problem currently: the loop only dereferences the stale 'ab' under hw_params->current_cc_support, which is set only for WCN7850 and QCC2072. Both devices expose a single radio per ath12k_hw, so 'ab' and ar->ab always point to the same ath12k_base. Still, relying on that is fragile. Cache ar->ab into a per-iteration 'this_ab' and use it for the country code programming and the log messages so that each radio is handled against its own ath12k_base regardless of how many radios an ath12k_hw spans. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Link: https://patch.msgid.link/20260729-ath12k-regd-wait-timeout-v1-2-504aa6e7e93c@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
ab->new_alpha2 is written under ab->base_lock by the 11d new country code event handler ath12k_reg_11d_new_cc_event() and by the SMBIOS BDF parser, and read under the same lock by ath12k_update_11d(). ath12k_mac_hw_register() however read ab->new_alpha2 without holding base_lock, racing with those writers. Take base_lock and copy the value into a local wmi_set_current_country_arg, mirroring what ath12k_update_11d() already does, and use the local copy afterwards. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Link: https://patch.msgid.link/20260729-ath12k-regd-wait-timeout-v1-3-504aa6e7e93c@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
… when unchanged Currently ath12k_mac_hw_register() unconditionally sets ab->new_alpha2 to firmware. But when ab->new_alpha2 is the same as the country already applied at boot time (stored in ab->default_regd), setting it again is meaningless. So skip it in that case. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Link: https://patch.msgid.link/20260729-ath12k-regd-wait-timeout-v1-4-504aa6e7e93c@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Hangtian Zhu (zhuhangtian)
force-pushed
the
tech/net/ath
branch
from
September 15, 2026 02:31
4926394 to
3a44e14
Compare
|
Dev Completion validation failed CR: 4659365 The change task for this CR could not be moved to Dev Complete because of the error above. Please resolve the issue in Orbit and re-run the failed Orbit check. |
miaoqing-quic
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On devices that support setting the current country code, the following
warning is seen during driver bring-up:
Timeout while waiting for regulatory update.
This happens when the country to be set during registration is the same as
the one already applied at boot time: the regulatory event from firmware
gets dropped without signalling the completion, so the waiter times out.
Fix it, and also skip setting the country code when it is unchanged.
Link: https://patch.msgid.link/20260729-ath12k-regd-wait-timeout-v1-1-504aa6e7e93c@oss.qualcomm.com
CRs-Fixed: 4659365