ath11k_ahb_probe() calls ath11k_ahb_config_irq() after ath11k_core_init(), which has already initialised the QMI client, created the debugfs directory, registered the PM notifier and booted the remote processor. When the IRQ configuration fails, the error path only unregisters the SSR notifier and frees the CE pipes and the resources below them, then frees ab: the firmware keeps running and the QMI client, whose callbacks post events into ab->qmi, the debugfs files and the PM notifier stay behind. The order was swapped by commit 166e22b38aa3 ("ath11k: ahb: call ath11k_core_init() before irq configuration") because the ext IRQ setup needs hw_params.max_radios. hw_params is now set in ath11k_core_pre_init(), which ath11k_ahb_probe() calls before it maps the resources, so configure the IRQs before ath11k_core_init() again, as ath11k_pci_probe() does, and free them when ath11k_core_init() fails. Nothing can fail after the firmware is booted then. The SSR notifier is now registered after the IRQ setup, which it disables on a shutdown, and unregistered in the new err_free_irq path. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1 Fixes: 166e22b38aa3 ("ath11k: ahb: call ath11k_core_init() before irq configuration") Signed-off-by: Julius Bairaktaris --- v3: new. drivers/net/wireless/ath/ath11k/ahb.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c index 893a3270394e..736fd368f8c6 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -1285,26 +1285,29 @@ static int ath11k_ahb_probe(struct platform_device *pdev) if (ret) goto err_ce_free; - ath11k_ahb_register_ssr_notifier(ab); - - ret = ath11k_core_init(ab); + ret = ath11k_ahb_config_irq(ab); if (ret) { - ath11k_err(ab, "failed to init core: %d\n", ret); + ath11k_err(ab, "failed to configure irq: %d\n", ret); goto err_ce_free; } - ret = ath11k_ahb_config_irq(ab); + ath11k_ahb_register_ssr_notifier(ab); + + ret = ath11k_core_init(ab); if (ret) { - ath11k_err(ab, "failed to configure irq: %d\n", ret); - goto err_ce_free; + ath11k_err(ab, "failed to init core: %d\n", ret); + goto err_free_irq; } ath11k_qmi_fwreset_from_cold_boot(ab); return 0; -err_ce_free: +err_free_irq: ath11k_ahb_unregister_ssr_notifier(ab); + ath11k_ahb_free_irq(ab); + +err_ce_free: ath11k_ce_free_pipes(ab); err_hal_srng_deinit: -- 2.53.0