* [PATCH ath-current v2 0/3] wifi: ath11k: fix QRTR readiness related WLAN initialization failures
@ 2026-08-06 10:13 Miaoqing Pan
2026-08-06 10:13 ` [PATCH ath-current v2 1/3] wifi: ath11k: fix sporadic " Miaoqing Pan
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Miaoqing Pan @ 2026-08-06 10:13 UTC (permalink / raw)
To: jjohnson; +Cc: ath11k, linux-wireless, linux-kernel, Miaoqing Pan
On WCN6750 platforms, QRTR SMD may not be available when ath11k starts
during boot. If QMI messages never arrive, WLAN initialization can stall,
leaving firmware running but no wireless interface created.
It also hardens the cleanup path to avoid crashes when deinitializing
partially initialized devices after QMI setup failures.
---
v2: Replace the ATH11K_FLAG_QMI_FAIL guard with !ATH11K_FLAG_REGISTERED.
---
Miaoqing Pan (3):
wifi: ath11k: fix sporadic WLAN initialization failures
wifi: ath11k: fix NULL dereference in ahb remove when QMI init
incomplete
wifi: ath11k: unregister PM notifier on QMI init failure path
drivers/net/wireless/ath/ath11k/Kconfig | 3 +++
drivers/net/wireless/ath/ath11k/ahb.c | 7 +++++--
2 files changed, 8 insertions(+), 2 deletions(-)
base-commit: 0ece44d394570806e97c8471a50dc9f584516ef6
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH ath-current v2 1/3] wifi: ath11k: fix sporadic WLAN initialization failures
2026-08-06 10:13 [PATCH ath-current v2 0/3] wifi: ath11k: fix QRTR readiness related WLAN initialization failures Miaoqing Pan
@ 2026-08-06 10:13 ` Miaoqing Pan
2026-08-06 10:13 ` [PATCH ath-current v2 2/3] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Miaoqing Pan
2026-08-06 10:13 ` [PATCH ath-current v2 3/3] wifi: ath11k: unregister PM notifier on QMI init failure path Miaoqing Pan
2 siblings, 0 replies; 4+ messages in thread
From: Miaoqing Pan @ 2026-08-06 10:13 UTC (permalink / raw)
To: jjohnson; +Cc: ath11k, linux-wireless, linux-kernel, Miaoqing Pan
On WCN6750 platforms, reboot stress testing occasionally results in WLAN
initialization failures after boot. The WPSS firmware reaches the running
state successfully, but no WLAN interface is created.
Analysis shows that ath11k_ahb depends on the QRTR SMD transport for QMI
communication with WPSS firmware. However, this dependency is not
currently expressed in Kconfig, allowing qrtr_smd and ath11k_ahb to load
in either order when built as modules.
If ath11k_ahb is loaded before qrtr_smd becomes available, WLAN
initialization may not complete successfully.
Make the QRTR and QRTR_SMD dependencies explicit and add a soft
dependency to ensure qrtr_smd is loaded before ath11k_ahb.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.2.0.c2-00204-QCAMSLSWPLZ-1
Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath11k/Kconfig | 3 +++
drivers/net/wireless/ath/ath11k/ahb.c | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/Kconfig b/drivers/net/wireless/ath/ath11k/Kconfig
index 122726f84492..44b520d2e66e 100644
--- a/drivers/net/wireless/ath/ath11k/Kconfig
+++ b/drivers/net/wireless/ath/ath11k/Kconfig
@@ -14,6 +14,9 @@ config ATH11K_AHB
tristate "Atheros ath11k AHB support"
depends on ATH11K
depends on REMOTEPROC
+ select RPMSG
+ select QRTR
+ select QRTR_SMD
help
This module adds support for AHB bus
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index ec5bf5c9fd79..e417b0a0f2d7 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1343,5 +1343,6 @@ static struct platform_driver ath11k_ahb_driver = {
module_platform_driver(ath11k_ahb_driver);
+MODULE_SOFTDEP("pre: qrtr_smd");
MODULE_DESCRIPTION("Driver support for Qualcomm Technologies 802.11ax WLAN AHB devices");
MODULE_LICENSE("Dual BSD/GPL");
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH ath-current v2 2/3] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete
2026-08-06 10:13 [PATCH ath-current v2 0/3] wifi: ath11k: fix QRTR readiness related WLAN initialization failures Miaoqing Pan
2026-08-06 10:13 ` [PATCH ath-current v2 1/3] wifi: ath11k: fix sporadic " Miaoqing Pan
@ 2026-08-06 10:13 ` Miaoqing Pan
2026-08-06 10:13 ` [PATCH ath-current v2 3/3] wifi: ath11k: unregister PM notifier on QMI init failure path Miaoqing Pan
2 siblings, 0 replies; 4+ messages in thread
From: Miaoqing Pan @ 2026-08-06 10:13 UTC (permalink / raw)
To: jjohnson; +Cc: ath11k, linux-wireless, linux-kernel, Miaoqing Pan
On WCN6750, if QMI messages never arrive (for example when qrtr_smd
is not ready), WLAN initialization stops before the device is fully
registered. In this case ATH11K_FLAG_QMI_FAIL is not set because no
QMI event handler is executed.
When the driver is removed, ath11k_ahb_remove() still calls
ath11k_core_deinit(), which eventually triggers
ath11k_ce_cleanup_pipes() on uninitialized CE pipes and results in a
NULL pointer dereference in ath11k_hal_srng_access_begin():
ath11k_hal_srng_access_begin+0x14/0x68 [ath11k]
ath11k_ce_cleanup_pipes+0x184/0x190 [ath11k]
ath11k_pcic_stop+0x24/0x38 [ath11k]
ath11k_core_deinit+0xfc/0x1c0 [ath11k]
ath11k_ahb_remove+0x38/0xa0 [ath11k_ahb]
Fix this by invoking ath11k_ahb_remove_prepare() before the state
check and skipping ath11k_core_deinit() if ATH11K_FLAG_REGISTERED
is not set, core initialization did not complete and CE pipes may
remain uninitialized, making ath11k_core_deinit() unsafe.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.2.0.c2-00204-QCAMSLSWPLZ-1
Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath11k/ahb.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index e417b0a0f2d7..c3ce5ea36e3c 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1296,14 +1296,15 @@ static void ath11k_ahb_remove(struct platform_device *pdev)
{
struct ath11k_base *ab = platform_get_drvdata(pdev);
- if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) {
+ ath11k_ahb_remove_prepare(ab);
+
+ if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) {
ath11k_ahb_power_down(ab, false);
ath11k_debugfs_soc_destroy(ab);
ath11k_qmi_deinit_service(ab);
goto qmi_fail;
}
- ath11k_ahb_remove_prepare(ab);
ath11k_core_deinit(ab);
qmi_fail:
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH ath-current v2 3/3] wifi: ath11k: unregister PM notifier on QMI init failure path
2026-08-06 10:13 [PATCH ath-current v2 0/3] wifi: ath11k: fix QRTR readiness related WLAN initialization failures Miaoqing Pan
2026-08-06 10:13 ` [PATCH ath-current v2 1/3] wifi: ath11k: fix sporadic " Miaoqing Pan
2026-08-06 10:13 ` [PATCH ath-current v2 2/3] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Miaoqing Pan
@ 2026-08-06 10:13 ` Miaoqing Pan
2 siblings, 0 replies; 4+ messages in thread
From: Miaoqing Pan @ 2026-08-06 10:13 UTC (permalink / raw)
To: jjohnson; +Cc: ath11k, linux-wireless, linux-kernel, Miaoqing Pan
ath11k_core_init() registers a PM notifier before the QMI server
becomes available. If the QMI server never arrives, the device remove()
path can take the early-exit path introduced for QMI initialization
failures, skipping ath11k_core_deinit().
As a result, the PM notifier remains registered after the ath11k base
object has been freed. A subsequent suspend or resume event may invoke
the stale notifier and trigger a use-after-free.
Fix this by explicitly unregistering the PM notifier in the QMI failure
cleanup path before releasing ath11k resources.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.2.0.c2-00204-QCAMSLSWPLZ-1
Fixes: 32d93b51bc7e ("wifi: ath11k: choose default PM policy for hibernation")
Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath11k/ahb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index c3ce5ea36e3c..ee3f493d2e44 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1302,6 +1302,7 @@ static void ath11k_ahb_remove(struct platform_device *pdev)
ath11k_ahb_power_down(ab, false);
ath11k_debugfs_soc_destroy(ab);
ath11k_qmi_deinit_service(ab);
+ ath11k_core_pm_notifier_unregister(ab);
goto qmi_fail;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-06 10:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 10:13 [PATCH ath-current v2 0/3] wifi: ath11k: fix QRTR readiness related WLAN initialization failures Miaoqing Pan
2026-08-06 10:13 ` [PATCH ath-current v2 1/3] wifi: ath11k: fix sporadic " Miaoqing Pan
2026-08-06 10:13 ` [PATCH ath-current v2 2/3] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Miaoqing Pan
2026-08-06 10:13 ` [PATCH ath-current v2 3/3] wifi: ath11k: unregister PM notifier on QMI init failure path Miaoqing Pan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox