Skip to content

[PATCH ath-next 0/4] wifi: ath12k: fix timeout while waiting for regulatory update on bring-up - #1119

Open
Hangtian Zhu (zhuhangtian) wants to merge 4 commits into
qualcomm-linux:qcom-6.18.yfrom
zhuhangtian:qcom-6.18.y
Open

Hangtian Zhu (zhuhangtian) wants to merge 4 commits into
qualcomm-linux:qcom-6.18.yfrom
zhuhangtian:qcom-6.18.y

Conversation

@zhuhangtian

Copy link
Copy Markdown

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

Baochen Qiang added 4 commits September 15, 2026 18:28
…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>
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No Change Task Found

No associated change tasks found for CR 4659365 on any of the following entities:

Entities:

  • kernel.qli.2.0

CR: 4659365

Please ensure the CR has a change task associated with at least one of the entities for this branch.

@qlijarvis

Copy link
Copy Markdown

PR #1119 — validate-patch

PR: #1119

Verdict Issues Detailed Report
⚠️ 3 Full report

Final Summary

  1. Lore link present: Yes - all 4 commits have Link: tags using patch.msgid.link (lore redirect service)
  2. Lore link matches PR commits: Cannot verify - lore mbox files not fetched (patch.msgid.link URLs not recognized by Jarvis fetch logic)
  3. Upstream patch status: Strong evidence of acceptance - maintainer Reviewed-by + Signed-off-by present; cannot verify merge status without lore thread
  4. PR present in qcom-next/topics: Yes - all 4 commit(s) are present in qcom-next or topics
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #1119 - wifi: ath12k regulatory update fixes (4 commits)
Upstream commit: https://patch.msgid.link/20260729-ath12k-regd-wait-timeout-v1-*-504aa6e7e93c@oss.qualcomm.com (series)
Verdict: ⚠️ PARTIAL

Commit Message

Check Status Note
Subject matches upstream ⚠️ Cannot verify - lore mbox not fetched (patch.msgid.link not recognized)
Body preserves rationale ⚠️ Cannot verify - lore mbox not fetched
Fixes tag present/correct Commit 1/4 has proper Fixes: tag; others are not bug fixes
Authorship preserved All commits: Baochen Qiang (original author)
Backport note (if applicable) N/A UPSTREAM: prefix - not a backport

Diff

File Status Notes
drivers/net/wireless/ath/ath12k/wmi.c ⚠️ Cannot verify against lore - no mbox fetched
drivers/net/wireless/ath/ath12k/mac.c ⚠️ Cannot verify against lore - no mbox fetched

Issues

  • Lore evidence not fetched: Jarvis did not recognize patch.msgid.link URLs as lore links and did not fetch the upstream mbox files. Cannot perform byte-by-byte diff comparison against upstream.
  • Strong positive indicators present: All commits have maintainer Reviewed-by and second Signed-off-by from Jeff Johnson (ath12k maintainer), suggesting these were accepted upstream.
  • Integration presence confirmed: All 4 commits present in topics branches with exact patch-id matches (see integration_presence_report.md).

Verdict

Merge with confidence - While lore mbox files were not fetched for direct comparison, all structural validation checks pass:

  • ✅ Proper UPSTREAM: prefix on all commits
  • ✅ Correct authorship (Baochen Qiang)
  • ✅ Complete sign-off chain (author → maintainer)
  • ✅ Reviewed-by tags present
  • ✅ Link: tags present (patch.msgid.link format)
  • ✅ Fixes: tag on commit 1/4 (the bug fix)
  • ✅ All 4 commits present in topics with exact patch-id match

The only limitation is the inability to verify the diff content matches upstream byte-for-byte due to missing lore mbox files.

Final Summary

  1. Lore link present: Yes - all 4 commits have Link: tags using patch.msgid.link (lore redirect service)
  2. Lore link matches PR commits: Cannot verify - lore mbox files not fetched (patch.msgid.link URLs not recognized by Jarvis fetch logic)
  3. Upstream patch status: Strong evidence of acceptance - maintainer Reviewed-by + Signed-off-by present; cannot verify merge status without lore thread
  4. PR present in qcom-next/topics: Yes - all 4 commits present in topics branches with exact patch-id matches (f2576dc, af8d103, 04497f2, 8ab8a5e)

Deterministic Integration Presence

Integration Presence Report

This report is generated by Jarvis before validate-patch runs.
It is the authoritative source for whether PR changes are already present
in qcom-next or in the kernel topic branches.

Kernel repo: /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel
qcom-next ref: d49c33864d06e9672dce57738be8851384578fcf
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/4 [PATCH 1/4] UPSTREAM: wifi: ath12k: signal regd update completion partial - subject or partial tree evidence found, but full change was not verified present - exact patch-id match at f2576dc present
2/4 [PATCH 2/4] UPSTREAM: wifi: ath12k: use per-radio ab in missing - no subject, patch-id, or full tree-content match found present - exact patch-id match at af8d103 present
3/4 [PATCH 3/4] UPSTREAM: wifi: ath12k: protect new_alpha2 access with missing - no subject, patch-id, or full tree-content match found present - exact patch-id match at 04497f2 present
4/4 [PATCH 4/4] UPSTREAM: wifi: ath12k: skip setting country code during missing - no subject, patch-id, or full tree-content match found present - exact patch-id match at 8ab8a5e present

Final Status

overall_status: PASS
present_commits: 4/4
partial_commits: 0/4
missing_commits: 0/4
topics_checked_for_commits: 4/4
final_summary: PR present in qcom-next/topics: Yes - all 4 commit(s) are present in qcom-next or topics

@qlijarvis

Copy link
Copy Markdown

PR #1119 — checker-log-analyzer

PR: #1119
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/34958519935

Checker Result Summary
Checker Result Summary
checkpatch 4 commits with COMMIT_LOG_LONG_LINE warnings on Tested-on: lines
dt-binding-check ⏭️ No changes in Documentation/devicetree/bindings
dtb-check ⏭️ No changes in Devicetree
sparse-check Passed
check-uapi-headers Passed
check-patch-compliance All 4 commits validated successfully
tag-check All commits have valid UPSTREAM: prefix (required for qcom-6.18.y)

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #1119 - wifi: ath12k: regulatory domain update fixes
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/34958519935

Checker Result Summary
checkpatch 4 commits with COMMIT_LOG_LONG_LINE warnings on Tested-on: lines
dt-binding-check ⏭️ No changes in Documentation/devicetree/bindings
dtb-check ⏭️ No changes in Devicetree
sparse-check Passed
check-uapi-headers Passed
check-patch-compliance All 4 commits validated successfully
tag-check All commits have valid UPSTREAM: prefix (required for qcom-6.18.y)

❌ checkpatch

Root cause: All four commits contain Tested-on: trailer lines that exceed the 75-character commit message line length limit.

Failure details:

Commit fcb62feeb270 ("UPSTREAM: wifi: ath12k: signal regd update completion when reg event is dropped")
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#30: 
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

Commit 4a2f87df436f ("UPSTREAM: wifi: ath12k: use per-radio ab in ath12k_mac_hw_register()")
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#24: 
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

Commit 4ad02a4a10a7 ("UPSTREAM: wifi: ath12k: protect new_alpha2 access with base_lock")
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#16: 
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

Commit c277d336aac8 ("UPSTREAM: wifi: ath12k: skip setting country code during registration when unchanged")
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#12: 
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

Fix:

These are Tested-on: trailer lines (92 characters) that exceed the 75-character commit body line limit. According to the skill's false-positive guide (Section 9), COMMIT_LOG_LONG_LINE warnings on Link: lines are acceptable false positives. The same principle applies to Tested-on: lines — they are metadata trailers that should not be wrapped.

However, if strict compliance is required, you can wrap the Tested-on: line by breaking it after the colon:

git rebase -i aff7542c319e   # mark each commit as 'edit'
# For each commit, edit the message:
git commit --amend
# Change:
#   Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3
# To:
#   Tested-on: WCN7850 hw2.0 PCI
#     WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3
git rebase --continue

Reproduce locally:

./scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES --git aff7542c319e..c277d336aac8

Verdict

Non-blocking style warnings only. The Tested-on: lines are metadata trailers similar to Link: lines — wrapping them reduces readability. These warnings are commonly accepted as false positives in the kernel community for trailer lines. All functional checkers (sparse, uapi, patch-compliance, tag-check) passed. Ready to merge as-is, or optionally wrap the Tested-on: lines if strict checkpatch compliance is required by your project policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants