Help with Lenovo Thinkpad P14s Gen4 AMD

Hello, I’ve got a shiny new laptop here and I’d like to get Qubes 4.2.3 running on it, but I’ve run into some snags. Here’s a list of problems I’ve encountered, and solutions where I’ve been able to find them:

Installer kernel panics on boot
Solution: Edit bootloader options, add module_blacklist=ucsi_acpi to the line containing vmlinuz

Trackpad does not work on installer boot
Additional issues in the installed Qubes environment includes screen blanking on FDE Password screen, screen brightness controls not responding correctly
Solution: Edit bootloader options, add ioapic_ack=new to line starting with multiboot2

To permanently fix the above at install-time:
Install as normal until you get to the end with the “Reboot Now” button
Press Ctrl-Alt-F2 to switch to another console
run nano /mnt/sysimage/boot/grub2/grub.cfg
add ioapic_ack=new to line starting with multiboot2
run nano /mnt/sysimage/etc/default/grub
add ioapic_ack=new to the quoted portion of the line beginning GRUB_CMDLINE_XEN_DEFAULT

Qubes does not seem to be able to turn off the internal display - It’ll blank it, but the backlight stays on no matter what power management settings I select.

Panel power-off is somewhat counter-intuitively (For a Windows user like me, at least) configured in XScreenSaver, not in Power Options.

I’ve so far discovered two issues which I haven’t been able to find solutions to:

Disconnecting the USB-C power-supply causes the machine to lock up and reboot - I presume this is a kernel panic that I’m just not able to see the text of.

Qualcomm QCNFA765 wifi does not work

The machine is running the latest BIOS published by Lenovo, version 1.39.

Troubleshooting advice would be much appreciated.

3 Likes

HCL

---
layout:
  'hcl'
type:
  'Notebook'
hvm:
  'yes'
iommu:
  'yes'
slat:
  'yes'
tpm:
  '2.0'
remap:
  'yes'
brand: |
  LENOVO
model: |
  21K5S0ES00
bios: |
  R2FET59W (1.39 )
cpu: |
  AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
cpu-short: |
  FIXME
chipset: |
  Advanced Micro Devices, Inc. [AMD] Device [1022:14e8]
chipset-short: |
  FIXME
gpu: |
  Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 [1002:15bf] (rev dd) (prog-if 00 [VGA controller])
gpu-short: |
  FIXME
network: |
  Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0e)
  Qualcomm Technologies, Inc QCNFA765 Wireless Network Adapter [17cb:1103] (rev 01)
memory: |
  31385
scsi: |

usb: |
  6
certified:
  'no'
versions:
  - works:
      'FIXME:yes|no|partial'
    qubes: |
      R4.2.3
    xen: |
      4.17.5
    kernel: |
      6.6.63-1
    remark: |
      FIXME
    credit: |
      FIXAUTHOR
    link: |
      FIXLINK

2 Likes

From the HCL support file

02:00.0 Network controller [0280]: Qualcomm Technologies, Inc QCNFA765 Wireless Network Adapter [17cb:1103] (rev 01)
	Subsystem: Lenovo Device [17aa:9309]
	Flags: fast devsel
	Memory at 78600000 (64-bit, non-prefetchable) [size=2M]
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable- Count=1/32 Maskable+ 64bit-
	Capabilities: [70] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [148] Secondary PCI Express
	Capabilities: [158] Transaction Processing Hints
	Capabilities: [1e4] Latency Tolerance Reporting
	Capabilities: [1ec] L1 PM Substates
	Kernel driver in use: pciback
	Kernel modules: ath11k_pci

From dmesg on sys-net

[    3.032924] ath11k_pci 0000:00:07.0: BAR 0: assigned [mem 0xf2000000-0xf21fffff 64bit]
[    3.035830] ath11k_pci 0000:00:07.0: MSI vectors: 1
[    3.036243] ath11k_pci 0000:00:07.0: wcn6855 hw2.1
...
[    3.198588] mhi mhi0: Requested to power ON
[    3.198614] mhi mhi0: Power on setup success
...
[   24.969818] mhi mhi0: Device failed to enter MHI Ready
[   24.969891] mhi mhi0: MHI did not enter READY state
[   24.970901] ath11k_pci 0000:00:07.0: failed to power up mhi: -110
[   24.970962] ath11k_pci 0000:00:07.0: failed to start mhi: -110
[   24.970998] ath11k_pci 0000:00:07.0: failed to power up :-110
[   24.976588] ath11k_pci 0000:00:07.0: failed to create soc core: -110
[   24.976612] ath11k_pci 0000:00:07.0: failed to init core: -110
[   24.976630] ------------[ cut here ]------------
[   24.976641] WARNING: CPU: 0 PID: 378 at kernel/irq/manage.c:1923 __free_irq+0x279/0x2b0
[   24.976666] Modules linked in: snd_seq_dummy snd_hrtimer snd_seq snd_seq_device snd_timer snd soundcore nft_nat nft_flow_offload nf_flow_table_inet nf_flow_table nf_conntrack_netlink nft_reject_ipv6 nf_reject_ipv6 nft_reject_ipv4 nf_reject_ipv4 nft_reject nft_ct nft_masq nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables joydev qrtr ath11k_pci(+) ath11k intel_rapl_msr intel_rapl_common qmi_helpers mac80211 libarc4 crct10dif_pclmul crc32_pclmul crc32c_intel polyval_clmulni polyval_generic cfg80211 ghash_clmulni_intel sha512_ssse3 sha256_ssse3 sha1_ssse3 rfkill mhi r8169 pcspkr drm_vram_helper drm_ttm_helper ehci_pci ata_generic ehci_hcd i2c_piix4 ttm pata_acpi serio_raw xen_scsiback target_core_mod xen_netback xen_privcmd xen_gntdev xen_gntalloc xen_blkback xen_evtchn loop fuse nfnetlink overlay xen_blkfront
[   24.976847] CPU: 0 PID: 378 Comm: (udev-worker) Not tainted 6.6.63-1.qubes.fc37.x86_64 #1
[   24.976865] Hardware name: Xen HVM domU, BIOS 4.17.5 11/12/2024
[   24.976882] RIP: 0010:__free_irq+0x279/0x2b0
[   24.976896] Code: 0f 0b e9 dc fd ff ff 49 8d 7f 28 e8 e1 35 e4 00 e9 ee fd ff ff 41 81 67 78 ff ff f7 ff 4c 89 ff e8 5c 1f 00 00 e9 33 fe ff ff <0f> 0b 49 c7 87 b8 00 00 00 00 00 00 00 e9 2f fe ff ff 48 89 ef e8
[   24.976931] RSP: 0018:ffffa3b1407038a0 EFLAGS: 00010082
[   24.976943] RAX: 0000000000000880 RBX: ffff9661420dd100 RCX: ffff966146fae550
[   24.976961] RDX: ffff96614ea21c90 RSI: ffff9661420dd100 RDI: ffff96614ea72a00
[   24.976978] RBP: 0000000000000246 R08: ffff966146fae500 R09: 0000000000000046
[   24.976994] R10: 0000000000000000 R11: 0000000000000000 R12: ffff96614ea72aa4
[   24.977010] R13: ffff96614ea72b60 R14: ffff96614ea21c90 R15: ffff96614ea72a00
[   24.977029] FS:  000070ad44ababc0(0000) GS:ffff966158600000(0000) knlGS:0000000000000000
[   24.977045] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   24.977059] CR2: 000057520856c0b0 CR3: 000000000cb50000 CR4: 0000000000750ef0
[   24.977077] PKRU: 55555554
[   24.977084] Call Trace:
[   24.977092]  <TASK>
[   24.977100]  ? __free_irq+0x279/0x2b0
[   24.977110]  ? __warn+0x81/0x130
[   24.977125]  ? __free_irq+0x279/0x2b0
[   24.977136]  ? report_bug+0x171/0x1a0
[   24.977150]  ? handle_bug+0x58/0x90
[   24.977168]  ? exc_invalid_op+0x17/0x70
[   24.977197]  ? asm_exc_invalid_op+0x1a/0x20
[   24.977245]  ? __free_irq+0x279/0x2b0
[   24.977290]  free_irq+0x32/0x70
[   24.977330]  ath11k_pcic_free_irq+0x5a/0xe0 [ath11k]
[   24.977409]  ath11k_pci_probe+0x4bf/0x4e0 [ath11k_pci]
[   24.977472]  local_pci_probe+0x45/0xa0
[   24.977516]  pci_call_probe+0x54/0x170
[   24.977560]  pci_device_probe+0x80/0x100
[   24.977600]  ? driver_sysfs_add+0x57/0xc0
[   24.977646]  really_probe+0x1a2/0x400
[   24.977687]  ? __pfx___driver_attach+0x10/0x10
[   24.977732]  __driver_probe_device+0x78/0x160
[   24.977779]  driver_probe_device+0x1f/0x90
[   24.977819]  __driver_attach+0xd2/0x1c0
[   24.977859]  bus_for_each_dev+0x88/0xd0
[   24.977902]  bus_add_driver+0x112/0x240
[   24.977944]  driver_register+0x59/0x100
[   24.977983]  ? __pfx_ath11k_pci_init+0x10/0x10 [ath11k_pci]
[   24.978037]  ath11k_pci_init+0x24/0x50 [ath11k_pci]
[   24.978092]  ? __pfx_ath11k_pci_init+0x10/0x10 [ath11k_pci]
[   24.978143]  do_one_initcall+0x5d/0x330
[   24.978191]  do_init_module+0x60/0x230
[   24.978233]  init_module_from_file+0x86/0xc0
[   24.978288]  idempotent_init_module+0x120/0x310
[   24.978341]  __x64_sys_finit_module+0x5e/0xb0
[   24.978390]  do_syscall_64+0x59/0x80
[   24.978435]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978483]  ? kmem_cache_free+0x27c/0x390
[   24.978525]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978555]  ? do_sys_openat2+0x97/0xe0
[   24.978569]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978582]  ? syscall_exit_work+0x103/0x130
[   24.978596]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978609]  ? syscall_exit_to_user_mode+0x22/0x40
[   24.978622]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978635]  ? do_syscall_64+0x65/0x80
[   24.978647]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978660]  ? __rseq_handle_notify_resume+0x36/0x60
[   24.978675]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978688]  ? exit_to_user_mode_loop+0xe1/0x150
[   24.978701]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978714]  ? exit_to_user_mode_prepare+0xbc/0xd0
[   24.978728]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978741]  ? syscall_exit_to_user_mode+0x22/0x40
[   24.978754]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978767]  ? do_syscall_64+0x65/0x80
[   24.978778]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978791]  ? do_syscall_64+0x65/0x80
[   24.978801]  ? switch_fpu_return+0x50/0xe0
[   24.978814]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978827]  ? exit_to_user_mode_prepare+0xb2/0xd0
[   24.978840]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978853]  ? syscall_exit_to_user_mode+0x22/0x40
[   24.978866]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978879]  ? do_syscall_64+0x65/0x80
[   24.978889]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978902]  ? syscall_exit_to_user_mode+0x22/0x40
[   24.978914]  ? srso_alias_return_thunk+0x5/0xfbef5
[   24.978927]  ? do_syscall_64+0x65/0x80
[   24.978937]  ? do_syscall_64+0x65/0x80
[   24.978948]  ? do_syscall_64+0x65/0x80
[   24.978958]  ? exc_page_fault+0x77/0x170
[   24.978970]  entry_SYSCALL_64_after_hwframe+0x78/0xe2
[   24.978983] RIP: 0033:0x70ad44d283dd
[   24.978994] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 0b da 0c 00 f7 d8 64 89 01 48
[   24.979028] RSP: 002b:00007fff09bbb078 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[   24.979046] RAX: ffffffffffffffda RBX: 00005d420f845c20 RCX: 000070ad44d283dd
[   24.979062] RDX: 0000000000000000 RSI: 000070ad452d807d RDI: 000000000000001b
[   24.979078] RBP: 00007fff09bbb130 R08: 0000000000000001 R09: 00007fff09bbb0c0
[   24.979094] R10: 0000000000000050 R11: 0000000000000246 R12: 000070ad452d807d
[   24.979110] R13: 0000000000020000 R14: 00005d420f845650 R15: 00005d420f848da0
[   24.979129]  </TASK>
[   24.979136] ---[ end trace 0000000000000000 ]---
[   25.047836] ath11k_pci: probe of 0000:00:07.0 failed with error -110
2 Likes

I went and installed kernel-latest for both dom0 and domU, and increased the memory allocation for sys-net to 1024MB

This also changed the USB-C power disconnect behavior - Qubes now manages to live for long enough to display a notification that the power supply has been disconnected, before freezing up and rebooting.

[    0.000000] Linux version 6.11.10-1.qubes.fc37.x86_64 (mockbuild@98260ff37ee0473287dfc4b33934ad19) (gcc (GCC) 12.3.1 20230508 (Red Hat 12.3.1-1), GNU ld version 2.38-27.fc37) #1 SMP PREEMPT_DYNAMIC Sun Nov 24 02:21:12 GMT 2024
...
[    3.573492] ath11k_pci 0000:00:07.0: BAR 0 [mem 0xf2000000-0xf21fffff 64bit]: assigned
[    3.576373] ath11k_pci 0000:00:07.0: MSI vectors: 1
[    3.577043] ath11k_pci 0000:00:07.0: wcn6855 hw2.1
...
[    3.772613] mhi mhi0: Requested to power ON
[    3.772694] mhi mhi0: Power on setup success
[    4.226394] mhi mhi0: Wait for device to enter SBL or Mission mode
...
[    4.854340] ath11k_pci 0000:00:07.0: chip_id 0x12 chip_family 0xb board_id 0xff soc_id 0x400c1211
[    4.854366] ath11k_pci 0000:00:07.0: fw_version 0x11088c35 fw_build_timestamp 2024-04-17 08:34 fw_build_id WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41
[    4.992797] ath11k_pci 0000:00:07.0: leaving PCI ASPM disabled to avoid MHI M2 problems
...
[    6.018430] ath11k_pci 0000:00:07.0: failed to receive control response completion, polling..
[    7.042458] ath11k_pci 0000:00:07.0: Service connect timeout
[    7.042502] ath11k_pci 0000:00:07.0: failed to connect to HTT: -110
[    7.043331] ath11k_pci 0000:00:07.0: failed to start core: -110
[    7.173499] vif vif-8-0 vif8.0: Guest Rx ready
[    7.252546] ath11k_pci 0000:00:07.0: firmware crashed: MHI_CB_EE_RDDM
[    7.252594] ath11k_pci 0000:00:07.0: ignore reset dev flags 0x4000
[    7.360063] ath11k_pci 0000:00:07.0: firmware crashed: MHI_CB_EE_RDDM
...
[   17.538497] ath11k_pci 0000:00:07.0: failed to wait wlan mode request (mode 4): -110
[   17.538577] ath11k_pci 0000:00:07.0: qmi failed to send wlan mode off: -110
2 Likes

Try setting swiotlb higher. This is kind of out of pocket guess but might work.

1 Like

Tried swiotlb=8192, 16384, and soft. No difference.
Digging through the logs, I did notice

[2024-12-07 20:02:19]  [2024-12-07 20:02:19] [00:07.0] xen_pt_realize: Assigning real physical device 02:00.0 to devfn 0x38 
[2024-12-07 20:02:19] [00:07.0] xen_pt_register_regions: IO region 0 registered (size=0x00200000 base_addr=0x78600000 type: 0x4) 
[2024-12-07 20:02:19] [00:07.0] xen_pt_config_reg_init: Offset 0x000e mismatch! Emulated=0x0080, host=0x0000, syncing to 0x0000. 
[2024-12-07 20:02:19] [00:07.0] xen_pt_config_reg_init: Offset 0x0010 mismatch! Emulated=0x0000, host=0x78600004, syncing to 0x78600004. 
[2024-12-07 20:02:19] [00:07.0] xen_pt_config_reg_init: Offset 0x0042 mismatch! Emulated=0x0000, host=0x0003, syncing to 0x0003. 
[2024-12-07 20:02:19] [00:07.0] xen_pt_pm_ctrl_reg_init_off: PCI power management control passthrough is off.
[2024-12-07 20:02:19] [00:07.0] xen_pt_config_reg_init: Offset 0x0074 mismatch! Emulated=0x0000, host=0x12c8fc0, syncing to 0x12c8fc0. 
[2024-12-07 20:02:19] [00:07.0] xen_pt_config_reg_init: Offset 0x007a mismatch! Emulated=0x0000, host=0x0010, syncing to 0x0010. 
[2024-12-07 20:02:19] [00:07.0] xen_pt_config_reg_init: Offset 0x0082 mismatch! Emulated=0x0000, host=0x1013, syncing to 0x1013. 
[2024-12-07 20:02:19] [00:07.0] xen_pt_realize: no pin interrupt 
[2024-12-07 20:02:19] [00:07.0] xen_pt_realize: Real physical device 02:00.0 registered successfully 

Note the Linux kernel is making logs about “Disabling ASPM to avoid problems with MHI.” Is Xen not letting the kernel do that, therefore causing MHI to fail?

2 Likes

What’s the device 0000:00:07.0? Your QCNFA765 wireless adapter is 02:00.0, but ath11k_pci fails to interact with 00:07.0. Sorry if I missed it somewhere in the logs.

I think that’s Xen’s remapping - 02:00.0 is the physical hardware, but Xen remaps it over to 0000:00:07.0 in the virtual hardware space of sys-net. You can see that in the first line of the logs I just posted.

Debian and Ubuntu people seem to solve this error by updating their drivers to very new ones:


wget http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-atheros_20221214-3_all.deb
sudo apt install ./firmware-atheros_20221214-3_all.deb

https://forums.debian.net/viewtopic.php?t=153686&sid=c830c112646ae168246a7aec1e484d61&start=20


  • The thing that I think made the difference (outlined in this post), run:
    • wget http://mirrors.kernel.org/ubuntu/pool/main/l/linux-firmware/linux-firmware_1.197_all.deb
    • sudo dpkg -i linux-firmware*.deb - this one actually gave me an error, I don’t know what’s up with that.

I’m pretty sure my sys-net already has much newer drivers than that

bash-5.2# rpm --query --all | grep atheros
atheros-firmware-20241110-1.fc41.noarch