From 14ad70570ffadb1949bc476cf1e74495fbff9cde Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Feb 26 2024 13:02:22 +0000 Subject: wifi: ath11k: thermal: don't try to register multiple times (bsc#1207948). --- diff --git a/patches.suse/wifi-ath11k-thermal-don-t-try-to-register-multiple-t.patch b/patches.suse/wifi-ath11k-thermal-don-t-try-to-register-multiple-t.patch new file mode 100644 index 0000000..41f3c84 --- /dev/null +++ b/patches.suse/wifi-ath11k-thermal-don-t-try-to-register-multiple-t.patch @@ -0,0 +1,56 @@ +From 50556081e09b9e2b75a215694dd2d166de611f56 Mon Sep 17 00:00:00 2001 +From: Kalle Valo +Date: Fri, 23 Feb 2024 17:20:33 +0200 +Subject: [PATCH] wifi: ath11k: thermal: don't try to register multiple times +Patch-mainline: Queued in subsystem maintainer repository +Git-commit: 50556081e09b9e2b75a215694dd2d166de611f56 +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git +References: bsc#1207948 + +Every time the firmware boots we call ath11k_core_qmi_firmware_ready() which +ends up calling ath11k_thermal_register(). So we try to register thermal +devices multiple times. And when we power off the firmware during +suspend/hibernation (implemented in the next patch) we get a warning in resume: + +hwmon hwmon4: PM: parent phy0 should not be sleeping + +Workaround this similarly like ath11k_mac_register() does by testing +ATH11K_FLAG_REGISTERED. + +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30 + +Signed-off-by: Kalle Valo +Signed-off-by: Baochen Qiang +Link: https://msgid.link/20240221024725.10057-6-quic_bqiang@quicinc.com +Acked-by: Takashi Iwai + +--- + drivers/net/wireless/ath/ath11k/thermal.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/ath/ath11k/thermal.c b/drivers/net/wireless/ath/ath11k/thermal.c +index c29b11ab5bfa..41e7499f075f 100644 +--- a/drivers/net/wireless/ath/ath11k/thermal.c ++++ b/drivers/net/wireless/ath/ath11k/thermal.c +@@ -1,7 +1,7 @@ + // SPDX-License-Identifier: BSD-3-Clause-Clear + /* + * Copyright (c) 2020 The Linux Foundation. All rights reserved. +- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. ++ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + + #include +@@ -163,6 +163,9 @@ int ath11k_thermal_register(struct ath11k_base *ab) + struct ath11k_pdev *pdev; + int i, ret; + ++ if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) ++ return 0; ++ + for (i = 0; i < ab->num_radios; i++) { + pdev = &ab->pdevs[i]; + ar = pdev->ar; +-- +2.35.3 + diff --git a/series.conf b/series.conf index 287dddb..44d1aa6 100644 --- a/series.conf +++ b/series.conf @@ -194,6 +194,7 @@ patches.suse/wifi-ath11k-remove-MHI-LOOPBACK-channels.patch patches.suse/wifi-ath11k-do-not-dump-SRNG-statistics-during-resum.patch patches.suse/wifi-ath11k-fix-warning-on-DMA-ring-capabilities-eve.patch + patches.suse/wifi-ath11k-thermal-don-t-try-to-register-multiple-t.patch ######################################################## # USB