[SOLVED] Qualcomm QCNFA765 (ath11k/wcn6855) WiFi working on Thinkpad P14s Gen4 AMD

Building and installing a patched kernel/modules to fix the Lenovo Qualcomm ath11k wifi driver crashing on startup

https://forum.qubes-os.org/t/38192

References
qubes-builderv2 readme
Kicksecure’s build notes
Verifying the Qubes Master Signing Key

These instructions have been tested and verified to work on a brand-new, completely uncustomized, up-to-date Qubes R4.3.0 installation on my ThinkPad P14s laptop.

Anything I put in [square brackets] requires you to think. That’s data values possibly specific to your machine, or your choice of [qube-names] if you don’t like mine. If you’re trying to copy/paste commandlines that have []s in them, you’re probably going to have a bad time.

**** Step 1 - Get MSI vector data for the wifi chip and prepare module options

in Dom0 terminal
  sudo lspci
    Locate bus address for Wifi interface - [probably 02:00.0]
  sudo lspci -s [bus_address] -vv | grep -A1 "MSI:"
    Record MSI address [probably 0xfee04000] and data [probably 0x4000]
  qvm-prefs -s sys-net kernelopts "ath11k_pci.host_msi_vector_addr=0x[address] ath11k_pci.host_msi_vector_data=0x[data]"

in Qube Manager
  Adjust settings for sys-net
    Increase Initial memory to at least 450MB - I recommend 600MB


**** Step 2 - Setting up the environment and host for qubes-builderv2

in Qube Manager
  Clone your fedora-42-xfce template as [sys-builder-template]
  Clone your default-dvm to [sys-builder-dvm]
  Adjust settings for [sys-builder-dvm]
    Basic tab
      Change the template to [sys-builder-template]
      Set private volume storage to 48GiB  <-- double check this. There's a UI quirk in Qube Manager that means it might not take
    Advanced tab
      Increase VCPUs as per your hardware - I set 6
  Create a new AppVM Qube, call it [sys-builder]
  Adjust settings for [sys-builder]
    On the Basic tab
      Set the Template to [sys-builder-template]
      Increase Private storage max size to 48GiB  <-- double check this.
    On the Advanced tab
      Set the Default disposable template to [sys-builder-dvm]

in [sys-builder] terminal
  git clone https://github.com/QubesOS/qubes-secpack.git
  gpg --import qubes-secpack/keys/*/*
  gpg --edit-key "Master Signing"
    fpr
      Verify the Primary key fingerprint reads exactly "427F 11FD 0FAA 4B08 0123  F01C DDFA 1A3E 3687 9494"
    trust
    5
    y
    q
  git clone https://github.com/QubesOS/qubes-builderv2/
  cd qubes-builderv2
  git tag -v $(git describe)
    Verify there are no errors and the last line of output starts with "gpg: Good signature from" and ends with "[full]"
  qvm-copy dependencies-fedora.txt dependencies-fedora-qubes-executor.txt
    Select [sys-builder-template] from the popup
  git submodule update --init
  sed -e 's/work-qubesos/[sys-builder]/g' -e 's/qubes-builder-dvm/[sys-builder-dvm]/g' rpc/policy/50-qubesbuilder.policy > /home/user/policy

in [sys-builder-template] terminal
  sudo dnf install $(cat QubesIncoming/[sys-builder]/dependencies-fedora.txt)
  sudo dnf install $(cat QubesIncoming/[sys-builder]/dependencies-fedora-qubes-executor.txt)

in Dom0 terminal
  sudo qvm-run --pass-io [sys-builder] -- 'cat /home/user/policy' > /etc/qubes/policy.d/50-qubesbuilder.policy

in [sys-builder-dvm] terminal
  sudo su
  mkdir -p /rw/bind-dirs/builder /rw/config/qubes-bind-dirs.d
  echo "binds+=('/builder')" > /rw/config/qubes-bind-dirs.d/builder.conf
  echo "mount /builder -o dev,suid,remount" >> /rw/config/rc.local

Shutdown [sys-builder-template], [sys-builder-dvm], [sys-builder]


**** Step 3 - Building prerequisites and kernel packages with qubes-builder

in [sys-builder] terminal
  cd qubes-builderv2
  cp example-configs/qubes-os-r4.3.yml builder.yml
  ./qb -c linux-utils package fetch prep build
  ./qb -c core-admin-linux package fetch prep build
  ./qb -c linux-kernel package fetch
  nano artifacts/sources/linux-kernel/kernel.spec.in
    After the line starting 'Patch63:', add a new line. Add a few newlines around here if you want to keep things readable. Feel free to add a comment if you like.
    Patch1000: 1000-ath11k-msi-workaround.patch
    <Ctrl-x>, y, <enter>
  nano artifacts/sources/linux-kernel/1000-ath11k-msi-workaround.patch
    Paste in the MSI patch
    <Ctrl-x>, y, <enter>
  echo [20251231] > artifacts/sources/linux-kernel/rel
    [feel free to use any arbitrary number]
  ./qb -c linux-kernel package prep
  ./qb -c linux-kernel package build
  ls artifacts/components/linux-kernel
    Record the exact name/version of the kernel you just built - mine was [6.12.63-20251231]


**** Step 4 - Pulling the binary packages into dom0 and installing them

in Dom0 terminal
  qvm-run --pass-io [sys-builder] -- 'cat /home/user/qubes-builderv2/artifacts/components/linux-kernel/[version]/host-fc41/build/rpm/kernel-devel-[version].qubes.fc41.x86_64.rpm' > kernel-devel-[version].qubes.fc41.x86_64.rpm
  qvm-run --pass-io [sys-builder] -- 'cat /home/user/qubes-builderv2/artifacts/components/linux-kernel/[version]/host-fc41/build/rpm/kernel-modules-[version].qubes.fc41.x86_64.rpm' > kernel-modules-[version].qubes.fc41.x86_64.rpm
  qvm-run --pass-io [sys-builder] -- 'cat /home/user/qubes-builderv2/artifacts/components/linux-kernel/[version]/host-fc41/build/rpm/kernel-qubes-vm-[version].qubes.fc41.x86_64.rpm' > kernel-qubes-vm-[version].qubes.fc41.x86_64.rpm
  sudo rpm -i ./kernel-devel-[version].qubes.fc41.x86_64.rpm
  sudo rpm -i ./kernel-modules-[version].qubes.fc41.x86_64.rpm
  sudo rpm -i ./kernel-qubes-vm-[version].qubes.fc41.x86_64.rpm
  qvm-prefs -s sys-net kernel [version].fc41

Restart sys-net - your Wifi should be working now!

You can delete [sys-builder], [sys-builder-dvm], and [sys-builder-template] if you are so inclined
You can also clear out the .rpm files out of dom0's home directory
2 Likes