Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 0/2] wifi: ath12k: Fix operation under virtio
@ 2026-05-05 17:24 Nazar Mokrynskyi
  2026-05-05 17:24 ` [PATCH 1/2] wifi: ath12k: skip PCIe global reset on initial power-up Nazar Mokrynskyi
  2026-05-05 17:24 ` [PATCH 2/2] wifi: ath12k: skip unknown direct buffer ring module IDs Nazar Mokrynskyi
  0 siblings, 2 replies; 5+ messages in thread
From: Nazar Mokrynskyi @ 2026-05-05 17:24 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, jeff.johnson, Nazar Mokrynskyi

I've been struggling with ath12k and even ath11k for years:
https://forum.openwrt.org/t/qcn9274-crashes-the-system-during-driver-load/239491?u=nazar-pc
https://forum.openwrt.org/t/qcn9074-doesnt-initialize-on-x86-64/163288?u=nazar-pc

With these patches it is finally possible to use QCN9274 under KVM with virtio.

First patch avoids global reset, allowing module to power on properly. Similar
patch should probably be added for ath11k too. Without this patch I was getting
the following:
```
[    6.856855] ath12k_pci 0000:01:00.0: BAR 0 [mem 0xfc600000-0xfc7fffff 64bit]: assigned
[    6.879292] ath12k_pci 0000:01:00.0: MSI vectors: 16
[    6.883931] ath12k_pci 0000:01:00.0: Hardware name: qcn9274 hw2.0
[    6.990901] ath12k_pci 0000:01:00.0: link down error during global reset
[    7.998602] ath12k_pci 0000:01:00.0: link failed to recover after global reset
[    8.011545] mhi mhi0: BHI offset: 0xffffffff is out of range: 0x200000
[    8.013095] ath12k_pci 0000:01:00.0: failed to set mhi state: INIT(0)
[    8.014588] ath12k_pci 0000:01:00.0: failed to start mhi: -34
[    8.016025] ath12k_pci 0000:01:00.0: failed to power up :-34
[    8.050113] ath12k_pci 0000:01:00.0: failed to create soc 0 core: -34
[    8.053079] ath12k_pci 0000:01:00.0: unable to create hw group
[    8.090241] ath12k_pci 0000:01:00.0: failed to init core: -34
[    8.554526] ath12k_pci 0000:01:00.0: probe with driver ath12k_pci failed with error -34
```

With the patch the process goes further:
```
[    6.897009] ath12k_pci 0000:01:00.0: BAR 0 [mem 0xfc600000-0xfc7fffff 64bit]: assigned
[    6.906501] ath12k_pci 0000:01:00.0: MSI vectors: 16
[    6.909033] ath12k_pci 0000:01:00.0: Hardware name: qcn9274 hw2.0
[    6.959630] mhi mhi0: Requested to power ON
[    6.960899] mhi mhi0: Power on setup success
[    7.128588] mhi mhi0: Wait for device to enter SBL or Mission mode
[    7.659325] ath12k_pci 0000:01:00.0: qmi dma allocation failed (20971520 B type 1), will try later with small size
[    7.670187] ath12k_pci 0000:01:00.0: memory type 10 not supported
[    7.674957] kmodloader: done loading kernel modules from /etc/modules.d/*
[    7.683773] ath12k_pci 0000:01:00.0: chip_id 0x0 chip_family 0xb board_id 0x1019 soc_id 0x401a2200
[    7.688137] ath12k_pci 0000:01:00.0: fw_version 0x160484db fw_build_timestamp 2025-12-09 20:09 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
[   10.611560] ath12k_pci 0000:01:00.0: Invalid module id 2
[   10.616467] ath12k_pci 0000:01:00.0: failed to parse tlv -22
[   10.747508] debugfs: File 'simulate_fw_crash' in directory 'pci-0000:01:00.0' already present!
[   10.752188] debugfs: File 'device_dp_stats' in directory 'pci-0000:01:00.0' already present!
[   10.770705] ieee80211 phy0: copying sband (band 1) due to VHT EXT NSS BW flag
[   10.774844] debugfs: File 'ath12k' in directory 'phy0' already present!
[   13.968334] ath12k_pci 0000:01:00.0: failed to send WMI_PDEV_SET_PARAM cmd
[   13.971771] ath12k_pci 0000:01:00.0: failed to set ac override for ARP: -108
[   13.975315] ath12k_pci 0000:01:00.0: fail to start mac operations in pdev idx 0 ret -108
[   14.123699] ath12k_pci 0000:01:00.0: link down error during global reset
[   14.167537] mhi mhi0: BHI offset: 0xffffffff is out of range: 0x200000
[   14.169031] ath12k_pci 0000:01:00.0: failed to set mhi state: INIT(0)
[   14.170504] ath12k_pci 0000:01:00.0: failed to start mhi: -34
```

Second patch fixes an issue I had in OpenWRT, which may have been caused by
firmware upgrade:
```
[   10.611560] ath12k_pci 0000:01:00.0: Invalid module id 2
[   10.616467] ath12k_pci 0000:01:00.0: failed to parse tlv -22
```

My understanding is that it is fine to ignore unknown capability of the
firmware, it should not be required if driver doesn't know about it anyway.

I noticed a very similar code in ath11k, but wasn't sure if the change is needed
there too, so skipped it. Though I have a strong suspicion the same firmware
mismatch might happen there too.

With both of those I can finally use QCN9274 under KVM virtual machine with
virtio, at least with `pci=noaer` on the host. Without `pci=noaer` the module
still boots and works properly, but any attempt to shut down or reboot
inevitably crashes the host, which I reported to vfio maintainers, but I'd
appreciate cooperation from ath12k maintainers too:
https://lore.kernel.org/kvm/70de9b8f-b7c7-481b-8cb1-931e3b82eb0e@mokrynskyi.com/

Nazar Mokrynskyi (2):
  wifi: ath12k: skip PCIe global reset on initial power-up
  wifi: ath12k: skip unknown direct buffer ring module IDs

 drivers/net/wireless/ath/ath12k/pci.c |  3 ++-
 drivers/net/wireless/ath/ath12k/wmi.c | 12 ++++--------
 2 files changed, 6 insertions(+), 9 deletions(-)

--
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-11 20:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 17:24 [PATCH 0/2] wifi: ath12k: Fix operation under virtio Nazar Mokrynskyi
2026-05-05 17:24 ` [PATCH 1/2] wifi: ath12k: skip PCIe global reset on initial power-up Nazar Mokrynskyi
2026-05-05 17:24 ` [PATCH 2/2] wifi: ath12k: skip unknown direct buffer ring module IDs Nazar Mokrynskyi
2026-05-11 19:02   ` Jeff Johnson
2026-05-11 20:10     ` Nazar Mokrynskyi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox