[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250109-fix_reboot_issues_with_hw_grouping-v1-1-fb39ec03451e@quicinc.com>
Date: Thu, 9 Jan 2025 09:55:29 +0530
From: Aditya Kumar Singh <quic_adisi@...cinc.com>
To: Kalle Valo <kvalo@...nel.org>, Jeff Johnson <jjohnson@...nel.org>,
Karthikeyan Periyasamy <quic_periyasa@...cinc.com>,
Harshitha Prem
<quic_hprem@...cinc.com>
CC: Jeff Johnson <jeff.johnson@....qualcomm.com>,
Kalle Valo
<quic_kvalo@...cinc.com>, <linux-wireless@...r.kernel.org>,
<ath12k@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
"Aditya Kumar
Singh" <quic_adisi@...cinc.com>
Subject: [PATCH 01/10] wifi: ath12k: prevent race condition in
ath12k_core_hw_group_destroy()
Currently, ath12k_core_hw_group_destroy() accesses its members without any
locking mechanism. This could lead to potential issues if these members are
modified by another thread concurrently.
Hence to mitigate this, use the available mutex lock.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Fixes: 6f245ea0ec6c ("wifi: ath12k: introduce device group abstraction")
Signed-off-by: Aditya Kumar Singh <quic_adisi@...cinc.com>
---
drivers/net/wireless/ath/ath12k/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index 0c6b35aac96eb8d6660cbf30f807a04619feebda..514494dd56ad206a72c52492774d3387dae82f70 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/module.h>
@@ -1712,6 +1712,7 @@ static void ath12k_core_hw_group_destroy(struct ath12k_hw_group *ag)
if (WARN_ON(!ag))
return;
+ mutex_lock(&ag->mutex);
for (i = 0; i < ag->num_devices; i++) {
ab = ag->ab[i];
if (!ab)
@@ -1719,6 +1720,7 @@ static void ath12k_core_hw_group_destroy(struct ath12k_hw_group *ag)
ath12k_core_soc_destroy(ab);
}
+ mutex_unlock(&ag->mutex);
}
static void ath12k_core_hw_group_cleanup(struct ath12k_hw_group *ag)
--
2.34.1
Powered by blists - more mailing lists