2024-05-31 02:40:21

by Baochen Qiang

[permalink] [raw]
Subject: [PATCH] wifi: ath12k: fix ACPI warning when resume

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 <[email protected]>
---
drivers/net/wireless/ath/ath12k/acpi.c | 2 ++
drivers/net/wireless/ath/ath12k/core.c | 2 ++
2 files changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/acpi.c b/drivers/net/wireless/ath/ath12k/acpi.c
index 443ba12e01f3..0555d35aab47 100644
--- a/drivers/net/wireless/ath/ath12k/acpi.c
+++ b/drivers/net/wireless/ath/ath12k/acpi.c
@@ -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));
}
diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index e7f628e935e4..92f442f8e03a 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -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);


base-commit: 6e7a5c6d5e38b93f9cc3289d66a597b9a4ca0403
--
2.25.1



2024-05-31 19:01:46

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH] wifi: ath12k: fix ACPI warning when resume

On 5/30/2024 7:40 PM, Baochen Qiang wrote:
> 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 <[email protected]>
Acked-by: Jeff Johnson <[email protected]>


2024-06-11 18:36:42

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] wifi: ath12k: fix ACPI warning when resume

Baochen Qiang <[email protected]> wrote:

> 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 <[email protected]>
> Acked-by: Jeff Johnson <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

8b2a12749b08 wifi: ath12k: fix ACPI warning when resume

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches