Repository navigation
mac80211: ath11k: add multiPD support and refactor QCN6122 accordingly - #25393
georgemoussalem wants to merge 1 commit into
Conversation
Formality Check: Suggestions AvailableWe checked this pull request against the contribution guidelines. Here is what needs your attention:
|
|
ath11k patches sent upstream for review for official support for MPD architecture and QCN6122 support: |
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- 4eab0a4 "mac80211: ath11k: add multiPD support and refactor QCN6122 accordingly": the
mac80211: ath11k:scope doesn't cover most of the commit. It also drops the qualcommax MPD rproc/SCM/mdt_loader kernel patches, adds a new qcom_scm patch, rewrites 17 ipq5018 DTS files and adds firmware-package symlinks. Split it into per-area commits (qualcommax:,ath11k-firmware:/linux-firmware:,mac80211:) or widen the subject.
Generated by Claude Code
| + init_completion(&ab_ahb->userpd_spawned); | ||
| + init_completion(&ab_ahb->userpd_ready); | ||
| + init_completion(&ab_ahb->userpd_stopped); |
There was a problem hiding this comment.
The completions are initialised only after the spawn/ready/stop-ack IRQs are requested, so an early IRQ calls complete() on an uninitialised completion. The same happens if a later platform_get_irq_byname_optional() returns -ENXIO: the caller ignores that error, userpd_id is already set, and ath11k_ahb_power_up() then waits on these completions. Move the three init_completion() calls before ath11k_ahb_init_userpd() and the IRQ loop.
Generated by Claude Code
| + if (ret && ret != -ENXIO) | ||
| + return dev_err_probe(&ab->pdev->dev, ret, | ||
| + "failed to configure userpd interrupts\n"); |
There was a problem hiding this comment.
This error return runs after ath11k_ahb_init_userpd() has already put ab_ahb in g_rproc_info->userpd[] and bumped num_userpd, but it skips ath11k_ahb_cleanup_userpd(). The probe then jumps to err_ce_free, not err_rproc_deconfigure. That leaves a dangling userpd[] pointer, and num_userpd never reaches 0, so the notifier and the rproc reference are never released. On this path, take the lock and run the same cleanup as err_cleanup_userpd.
Generated by Claude Code
| err_unreg_notifier: | ||
| ath11k_ahb_unregister_rproc_notifier(); |
There was a problem hiding this comment.
All user PDs share the root-PD SSR notifier. If a second device (for example QCN6122) fails M3 load or root-PD boot, this path unregisters the notifier while other user PDs are still registered. Only the rproc put/free below is guarded by num_userpd. Put the unregister under the same !g_rproc_info->num_userpd check.
Generated by Claude Code
| + | ||
| + mem_phys = res.start; | ||
| + mem_size = resource_size(&res); | ||
| + mem_region = devm_memremap(ab->dev, mem_phys, mem_size, MEMREMAP_WC); |
There was a problem hiding this comment.
devm_memremap() returns an ERR_PTR on failure, and that value goes unchecked into qcom_mdt_load_no_init(). Add an IS_ERR(mem_region) check that returns PTR_ERR(), then refresh the patch with make package/mac80211/refresh.
Generated by Claude Code
| + case M3_DUMP_REGION_TYPE: | ||
| + ret = ath11k_qmi_reserved_memory_to_resource(ab, M3_DUMP_REGION_TYPE, &res); |
There was a problem hiding this comment.
This replaces the dropped 931 patch, which read qcom,m3-dump-addr. ipq6010-wax610-base.dtsi:208 still sets that property and is not converted. As a result, the WAX610 silently loses its M3 dump segment. Convert that board to an m3-dump memory-region, or keep the property as a fallback.
Generated by Claude Code
| + ret = qcom_scm_pas_set_wifi_power_mode(MPD_WCNSS_PAS_ID, true); | ||
| + if (ret) { | ||
| + ath11k_err(ab, "failed to power up wifi: %d\n", ret); | ||
| + return ret; |
There was a problem hiding this comment.
The 0192 SCM patch says "Not all Trusted Execution Environment (QSEE) images support this call" and returns -EOPNOTSUPP in that case. Here any error aborts the IPQ5018 user-PD boot. Is it intentional that such TZ images cannot bring up the IPQ5018 radio, or should -EOPNOTSUPP be tolerated here?
Generated by Claude Code
| EXPORT_SYMBOL_GPL(qcom_scm_pas_supported); | ||
|
|
||
| +/** | ||
| + * qcom_scm_pas_set_wifi_power_mode() - Power on/off internal wifi |
There was a problem hiding this comment.
nit: trailing whitespace.
| + * qcom_scm_pas_set_wifi_power_mode() - Power on/off internal wifi | |
| + * qcom_scm_pas_set_wifi_power_mode() - Power on/off internal wifi |
Generated by Claude Code
| + * Multi-UserPD Architecture: | ||
| + * | ||
| + * One Q6 RootPD (managed by separate rproc driver) supports multiple | ||
| + * ath12k UserPDs. Each UserPD represents a WiFi radio instance. |
There was a problem hiding this comment.
nit: this is the ath11k driver.
| + * ath12k UserPDs. Each UserPD represents a WiFi radio instance. | |
| + * ath11k UserPDs. Each UserPD represents a WiFi radio instance. |
Generated by Claude Code
| qcom,userpd-subsys-name = "q6v5_wcss_userpd2"; | ||
| qcom,rproc = <&q6v5_wcss>; | ||
| qcom,ath11k-calibration-variant = "CMCC-PZ-L8"; | ||
| qcom,ath11k-fw-memory-mode = <1>; |
There was a problem hiding this comment.
nit: every other QCN6122 board that dropped qcom,bdf-addr/qcom,m3-dump-addr gained memory-region/memory-region-names on &wifi1, but this one did not. The node is still disabled, but enabling it would fall back to the hardcoded BDF address with no M3 dump. Is this omission intentional?
Generated by Claude Code
There was a problem hiding this comment.
| CONFIG_PWM_IPQ=y | ||
| CONFIG_QCA83XX_PHY=y | ||
| CONFIG_QCOM_APM=y | ||
| CONFIG_QCOM_Q6V5_MPD=y |
There was a problem hiding this comment.
nit: the MPD rproc driver patches are gone, so # CONFIG_QCOM_Q6V5_MPD is not set in config-6.18:449 now refers to a symbol that no longer exists. Drop that line as well.
Generated by Claude Code
There was a problem hiding this comment.
d615a80 to
38d4e93
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- 38d4e93 "mac80211: ath11k: add multiPD support and refactor QCN6122 accordingly": the
mac80211: ath11k:scope covers only part of this commit. It also changes qualcommax kernel patches, config, and 17 ipq5018 DTS files, plus the firmware packages. Split it by area (qualcommax:, firmware,mac80211:) or widen the subject to match.
Generated by Claude Code
| * available for users. To prevent OOM when using LuCI or other softwares, | ||
| * disable Wi-Fi related peripherals at the moment. | ||
| */ | ||
| &q6_region { |
There was a problem hiding this comment.
nit: stray leading space before the node reference.
| &q6_region { | |
| &q6_region { |
Generated by Claude Code
| /* type: */ 0x1 /* PCIe0 */ | ||
| /* length: */ 2 | ||
| /* UPD ID: */ 2 | ||
| /* reset GPIO: */ 15>; |
There was a problem hiding this comment.
This board passes length = 2 and leaves out the two reserved words. Every other ipq5018 board uses length = 4 with the trailing 0 0, and the v1 layout table in the wcss_sec bootargs patch also lists length 0x04. Is the shorter form intentional for the B3000 firmware? If not, use the same shape as the siblings.
| /* type: */ 0x1 /* PCIe0 */ | |
| /* length: */ 2 | |
| /* UPD ID: */ 2 | |
| /* reset GPIO: */ 15>; | |
| /* type: */ 0x1 /* PCIe0 */ | |
| /* length: */ 4 | |
| /* UPD ID: */ 2 | |
| /* reset GPIO: */ 15 | |
| /* reserved: */ 0 0>; |
Generated by Claude Code
There was a problem hiding this comment.
this is by design as the b3000's bootloader pre-allocates 8 bytes for SMEM item 507 only which is used to pass the boot-args from the host to the firmware and this can't be adjusted in runtime.
The firmware accepts a TLV of which the first two bytes of the value really matter: UPD ID and reset-gpio.
9068184 to
0d843a2
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- 0d843a2 "mac80211: ath11k: add multiPD support and refactor QCN6122 accordingly": the
mac80211: ath11k:scope still covers only part of this commit. It also touches qualcommax kernel patches, config and ipq5018 DTS files (now including gl-x2000), plus the firmware packages. Split it by area or widen the subject.
Generated by Claude Code
Add native multiPD support to the ath11k driver and refactor QCN6122
support accordingly.
The IPQ5018 platform is a multiPD platform and the current ath11k driver
supports standalone IPQ5018 WiFi only. However, IPQ5018 boards come with
up to two optional SoC-specific QCN6122 WiFi companion chips for 5G/6G
WiFi.
IPQ5018 implements the multi-PD architecture as follows:
+-----------------------------+
| Q6 Remote Processor |
| RootPD |
+--------------+--------------+
|
|
|
+---------------------+---------------------+
| | |
+-----v-----+ +-----v-----+ +-----v-----+
| UserPD1 | | UserPD2 | | UserPD3 |
| IPQ5018 | | QCN6122 openwrt#1| | QCN6122 openwrt#2|
| (Radio) | | (Radio) | | (Radio) |
+-----------+ +-----------+ +-----------+
The rootPD is responsible for managing the lifecycle of the UserPD and
shared resources and providing SSR notifiers. There are different
firmware blobs that include either the rootPD and userPD binaries for
IPQ5018-only which auto-spawns the userPD for IPQ5018 WiFi, or for
IPQ5018 and QCN6122 for which the userPDs for each radio must be spawned
by the ath11k driver.
Upstream direction is to have the WCSS rproc driver load the Q6 firmware
and have the ath11k driver load the M3 firmware just like ath12k loads
the IU firmware.
In addition, new firmware blobs are expected to be published in a single
MBN format which contains all MDT segments. In the meantime, to
facilitate a migration from MDT split firmware files to MBN, add new
symlinks for both Q6 and M3 firmware files, pointing .mbn to the
existing respective .mdt files.
Ath11k now looks for specific hardware interrupts and SMEM entries to
spawn and stop a user PD from the root PD which is loaded by the rproc
driver. The driver then looks up the user PD ID from SMEM which the
firmware sets upon rproc boot. When these aren't defined in the
devicetree, it continues normal AHB bringup and initialization.
As user PD loading is now handled by the ath11k wifi driver, drop
support for the downstream MPD rproc driver which wasn't accepted
upstream and other related patches.
Signed-off-by: George Moussalem <[email protected]>
0d843a2 to
0135e61
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- 0135e61 "mac80211: ath11k: add multiPD support and refactor QCN6122 accordingly": the
mac80211: ath11k:scope still covers only part of the commit. It also changes qualcommax kernel patches, config, ipq5018 DTS files (now including mr80x-v2 and re700x) and the firmware packages. Split the commit by area or widen the subject.
Generated by Claude Code
| /* | ||
| * QCN6122 5 GHz. Uses the canonical OpenWrt PD2 memory layout | ||
| * (bdf 0x4d100000 / m3-dump 0x4df00000) and the stock-derived | ||
| * (bdf 0x4d200000 / m3-dump 0x4df00000) and the stock-derived |
There was a problem hiding this comment.
nit: this node no longer sets qcom,bdf-addr. 0x4d200000 is now the base of the q6-region memory region, so describe it that way.
| * (bdf 0x4d200000 / m3-dump 0x4df00000) and the stock-derived | |
| * (q6-region 0x4d200000 / m3-dump 0x4df00000) and the stock-derived |
Generated by Claude Code
…5393 George Moussalem's PR carries our PR #13 series (911-916, 920-925) rebased on backports 7.2: the root PD rproc notifier, the m3 firmware, the bdf/m3-dump addresses from the DTS, the userpd interrupts, SMEM entries and power sequencing, and the QCN6122 hw params, hal regs, ring masks and hif ops on top of main's single-PD support. Taken as the PR's patches/ath11k/ delta against its base (aa77344..0135e61); 912, 913, 915, 916, 920-923, 950, 951 are byte-identical to what we carried, 911 differs by the dev_err_probe() form, 914 by whitespace. Signed-off-by: Stanislaw Pal <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]>
OpenWrt main of 2026-10-14 (0eb0873), 168 commits past the base of this branch. Kernel 6.18.55 and the mac80211 package are unchanged. Resolved: - ipq8074-rt-ax89x.dts: main's qca-etype tag for the QCA8337, which main now carries itself. - image/ipq50xx.mk: the TP-Link EX511 v2 of this branch and main's Wallys DR5018S, both. Adapted to this tree: - 0955/0956, main's qca-etype tagger for qca8k. Protocol value 36 instead of 33, which is the qca-8021q tagger here (34 and 35 are the rtl8365mb-8021q and an8855-8021q ones). qca-etype becomes a case of the change_tag_protocol that the qca-8021q tagger brings already, instead of a second definition; the HEADER_CTRL write is kept as qca8k_set_hdr_etype(), and Ethernet management runs in both header modes. - 0959 (an8855-8021q): enum context after the qca-etype lines. Left out: - 0818-remoteproc-qcom_q6v5_mpd-skip-MSA-lock-for-internal-radio: it patches qcom_q6v5_mpd.c, which this tree does not build; its IPQ5018 multi-PD runs on qcom_q6v5_wcss_sec (openwrt#25393). Whether the Wallys DR5018S needs the same on that driver is untested. Signed-off-by: Stanislaw Pal <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@georgemoussalem Is there any plan to get it back to "ready to merge"? |
Add native multiPD support to the ath11k driver and refactor QCN6122 support accordingly.
The IPQ5018 platform is a multiPD platform and the current ath11k driver supports standalone IPQ5018 WiFi only. However, IPQ5018 boards come with up to two optional SoC-specific QCN6122 WiFi companion chips for 5G/6G WiFi.
IPQ5018 implements the multi-PD architecture as follows:
The rootPD is responsible for managing the lifecycle of the UserPD and shared resources and providing SSR notifiers. There are different firmware blobs that include either the rootPD and userPD binaries for IPQ5018-only which auto-spawns the userPD for IPQ5018 WiFi, or for IPQ5018 and QCN6122 for which the userPDs for each radio must be spawned by the ath11k driver.
Upstream direction is to have the WCSS rproc driver load the Q6 firmware and have the ath11k driver load the M3 firmware just like ath12k loads the IU firmware.
In addition, new firmware blobs are expected to be published in a single MBN format which contains all MDT segments. In the meantime, to facilitate a migration from MDT split firmware files to MBN, add new symlinks for both Q6 and M3 firmware files, pointing .mbn to the existing respective .mdt files.
Ath11k now looks for specific hardware interrupts and SMEM entries to spawn and stop a user PD from the root PD which is loaded by the rproc driver. The driver then looks up the user PD ID from SMEM which the firmware sets upon rproc boot. When these aren't defined in the devicetree, it continues normal AHB bringup and initialization.
As user PD loading is now handled by the ath11k wifi driver, drop support for the downstream MPD rproc driver which wasn't accepted upstream and other related patches.