Control: tags -1 + upstream + patch
Hi Jeron
Thank you for the detailed bug report and decoded pstore trace.
I've sent a fix series has been sent upstream to the ath11k and
linux-wireless mailing list.
https://lore.kernel.org/all/2026…@est.tech/
Before this fix is merged upstream, I'd like to ask you to test the following
workaround. Memory compaction before suspend may prevent fragmentation from
triggering this order-8 allocation failure. Please run:
echo 1 > /proc/sys/vm/compact_memory
TL;DR
=====
Your ThinkPad P16v Gen 1 (AMD) powers off the Qualcomm WCN6855 card
during s2idle and executes firmware crash recovery on resume:
ath11k_core_restart() -> ath11k_core_reconfigure_on_crash()
In this path, ath11k_dp_alloc() reallocates the host-side TX completion
status ring:
size = sizeof(struct hal_wbm_release_ring) * DP_TX_COMP_RING_SIZE;
= 32 bytes * 32768 entries = 1 MiB (order 8)
During system suspend and resume, the PM subsystem restricts memory
allocation flags:
pm_suspend()
→ enter_state()
→ suspend_devices_and_enter()
→ dpm_suspend_start(PMSG_SUSPEND)
→ dpm_prepare()
→ pm_restrict_gfp_mask()
→ dpm_suspend()
Here, pm_restrict_gfp_mask() masks out I/O and filesystem flags:
gfp_allowed_mask &= ~(__GFP_IO | __GFP_FS); // GFP_NOIO | __GFP_COMP
Even though ath11k requests GFP_KERNEL, the PM mask restricts it to
GFP_NOIO. Under GFP_NOIO:
- Direct memory compaction is disabled (gfp_compaction_allowed() is false).
- Page reclaim cannot perform I/O to swap out or flush dirty pages.
Once memory becomes fragmented over several days of uptime, the buddy
allocator cannot find a contiguous 1 MiB (order-8) block, so the
allocation fails with -ENOMEM despite hundreds of megabytes of free RAM.
When ath11k_dp_alloc() failed with -ENOMEM,
ath11k_core_reconfigure_on_crash() took an incorrect error exit:
1. It called ath11k_hal_srng_deinit(ab), freeing the shared ring memory
(hal->rdp). However, HAL SRNG memory belongs to the driver
probe/remove lifecycle, and copy-engine rings had already been
reinitialized pointing into it.
2. It cleared ATH11K_FLAG_CRASH_FLUSH before reconfiguration and failed
to restore it on error.
When the PM core continued resuming child devices, mac80211 called
ath11k_mac_op_start(), queueing a WMI command via ath11k_ce_send().
Because CRASH_FLUSH was not set, ath11k_ce_send() proceeded and called
ath11k_hal_srng_access_begin(), which dereferenced the tail pointer in
the freed rdp buffer. Behind an IOMMU, unmapping the buffer left an empty
PTE. Dereferencing it with spin_lock_bh held triggered a fatal page fault
in interrupt context, panicking the kernel.
Regards,
Yunseong
Bug#1152007: linux-image-7.2.9+deb13-amd64: kernel panic on resume (s2idle) in ath11k after order-8 allocation failure in ath11k_dp_alloc
- From
- Yunseong Kim <y…@kzalloc.com>
- Reply-To
- Yunseong Kim <y…@kzalloc.com>, 1152…@bugs.debian.org
- Sender
- robo…@news.nic.it
- Organization
- linux.* mail to news gateway
- Message-ID
- <NUZk…@gated-at.bofh.it>
- Date
- Newsgroups
- linux.debian.bugs.dist, linux.debian.kernel
Moderated This group is moderated.