WiFi kernel driver randomly not loaded

Since some weeks ago when I boot my laptop the wifi card is not detected. It happens randomly: sometimes I boot and everything is fine but sometimes the only way to connect to internet is via ethernet.

I’m running QubesOs R4.2.4 on HP Pavillion laptop. My sys-net qube is fedora-40-xfce based with 6.12.21 kernel.

When the problem appears I can see the following on sys-net qube:

  1. commands $ iw list and $ iw dev produce no output
  2. the kernel driver of the wifi card is not loaded:
$ lspci -v
...
00:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller (rev 16)
	Subsystem: Hewlett-Packard Company Device 8742
	Physical Slot: 6
	Flags: bus master, fast devsel, latency 0, IRQ 40
	I/O ports at c200 [size=256]
	Memory at f2028000 (64-bit, non-prefetchable) [size=4K]
	Memory at f2020000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: <access denied>
	Kernel driver in use: r8169
	Kernel modules: r8169

00:07.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter
	Subsystem: Hewlett-Packard Company Device 85f7
	Physical Slot: 7
	Flags: fast devsel, IRQ 44
	I/O ports at c300 [size=256]
	Memory at f2010000 (64-bit, non-prefetchable) [size=64K]
	Capabilities: <access denied>
	Kernel modules: rtw88_8822ce
  1. errors in the dmesg output:
$ sudo dmesg | grep rtw
[    3.214569] rtw_8822ce 0000:00:07.0: failed to init rx buffer
[    3.214575] rtw_8822ce 0000:00:07.0: failed to allocate pci resources
[    3.214583] rtw_8822ce 0000:00:07.0: failed to setup pci resources
[    3.230186] rtw_8822ce 0000:00:07.0: WOW Firmware version 9.9.4, H2C version 15
[    3.232044] rtw_8822ce 0000:00:07.0: probe with driver rtw_8822ce failed with error -12
  1. passing kernel option pci=nomsi doesn’t help
  2. loaded modules are:
$ lsmod | grep rtw88_8822
rtw88_8822ce           12288  0
rtw88_8822c           512000  1 rtw88_8822ce
rtw88_pci              40960  1 rtw88_8822ce
rtw88_core            307200  2 rtw88_pci,rtw88_8822c

I’ve read posts about similar problems on the forum (like this or this one) but I’ve not been able to fix the problem.

TIA for your help.