mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 00:11:13 +00:00
524704e677
Synchronize the ath11k backports with the current ath-next tree. This backports several memory leak issues, PCI IRQ fixup, peer add locking fix as well as IPQ5018 support, though IPQ5018 support is unused for now. This allows to easily backport further fixes as cherry picking them has started requiring manual conflict resolution. Signed-off-by: Robert Marko <robimarko@gmail.com>
54 lines
1.8 KiB
Diff
54 lines
1.8 KiB
Diff
From 60b7d62ba8cdbd073997bff0f1cdae8d844002c0 Mon Sep 17 00:00:00 2001
|
|
From: Christian Marangi <ansuelsmth@gmail.com>
|
|
Date: Thu, 9 Feb 2023 23:26:22 +0100
|
|
Subject: [PATCH] wifi: ath11k: fix SAC bug on peer addition with sta band
|
|
migration
|
|
|
|
Fix sleep in atomic context warning detected by Smatch static checker
|
|
analyzer.
|
|
|
|
Following the locking pattern for peer_rhash_add lock tbl_mtx_lock mutex
|
|
always even if sta is not transitioning to another band.
|
|
This is peer_add function and a more secure locking should not cause
|
|
performance regression.
|
|
|
|
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1
|
|
|
|
Fixes: d673cb6fe6c0 ("wifi: ath11k: fix peer addition/deletion error on sta band migration")
|
|
Reported-by: Dan Carpenter <error27@gmail.com>
|
|
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
|
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
|
Link: https://lore.kernel.org/r/20230209222622.1751-1-ansuelsmth@gmail.com
|
|
---
|
|
drivers/net/wireless/ath/ath11k/peer.c | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/ath/ath11k/peer.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/peer.c
|
|
@@ -382,22 +382,23 @@ int ath11k_peer_create(struct ath11k *ar
|
|
return -ENOBUFS;
|
|
}
|
|
|
|
+ mutex_lock(&ar->ab->tbl_mtx_lock);
|
|
spin_lock_bh(&ar->ab->base_lock);
|
|
peer = ath11k_peer_find_by_addr(ar->ab, param->peer_addr);
|
|
if (peer) {
|
|
if (peer->vdev_id == param->vdev_id) {
|
|
spin_unlock_bh(&ar->ab->base_lock);
|
|
+ mutex_unlock(&ar->ab->tbl_mtx_lock);
|
|
return -EINVAL;
|
|
}
|
|
|
|
/* Assume sta is transitioning to another band.
|
|
* Remove here the peer from rhash.
|
|
*/
|
|
- mutex_lock(&ar->ab->tbl_mtx_lock);
|
|
ath11k_peer_rhash_delete(ar->ab, peer);
|
|
- mutex_unlock(&ar->ab->tbl_mtx_lock);
|
|
}
|
|
spin_unlock_bh(&ar->ab->base_lock);
|
|
+ mutex_unlock(&ar->ab->tbl_mtx_lock);
|
|
|
|
ret = ath11k_wmi_send_peer_create_cmd(ar, param);
|
|
if (ret) {
|