]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: fix ACPI warning when resume
authorBaochen Qiang <quic_bqiang@quicinc.com>
Tue, 11 Jun 2024 06:42:33 +0000 (09:42 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Tue, 11 Jun 2024 18:36:22 +0000 (21:36 +0300)
Currently ACPI notification handler is installed when driver loads and only
gets removed when driver unloads. During resume after firmware is reloaded,
ath12k tries to install it by default. Since it is installed already, ACPI
subsystem rejects it and returns an error:

[   83.094206] ath12k_pci 0000:03:00.0: failed to install DSM notify callback: 7

Fix it by removing that handler when going to suspend. This also avoid any
possible ACPI call to firmware before firmware is reloaded/reinitialized.

Note ab->acpi also needs to be cleared in ath12k_acpi_stop() such that we
are in a clean state when ACPI structures are reinitialized in
ath12k_acpi_start().

Tested-on: WCN7850 HW2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Fixes: 576771c9fa21 ("wifi: ath12k: ACPI TAS support")
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240531024000.9291-1-quic_bqiang@quicinc.com
drivers/net/wireless/ath/ath12k/acpi.c
drivers/net/wireless/ath/ath12k/core.c

index 443ba12e01f375e77b0088f9b02e778b5eaf9f82..0555d35aab477a5f42906b4bf367f1db3dd5ee94 100644 (file)
@@ -391,4 +391,6 @@ void ath12k_acpi_stop(struct ath12k_base *ab)
        acpi_remove_notify_handler(ACPI_HANDLE(ab->dev),
                                   ACPI_DEVICE_NOTIFY,
                                   ath12k_acpi_dsm_notify);
+
+       memset(&ab->acpi, 0, sizeof(ab->acpi));
 }
index 4c3eab4686c240df874e9ba824c7fdd635a938ff..da02d35287376a1422bc9143a1d05ae7392c2b7e 100644 (file)
@@ -83,6 +83,8 @@ int ath12k_core_suspend_late(struct ath12k_base *ab)
        if (!ab->hw_params->supports_suspend)
                return -EOPNOTSUPP;
 
+       ath12k_acpi_stop(ab);
+
        ath12k_hif_irq_disable(ab);
        ath12k_hif_ce_irq_disable(ab);