Skip to content

Commit

Permalink
mac80211: add bugfix for ath11k fw crash
Browse files Browse the repository at this point in the history
Fixes: WIFI-14201
Signed-off-by: John Crispin <[email protected]>
  • Loading branch information
blogic committed Dec 13, 2024
1 parent ee80309 commit 096f9e9
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
--- a/drivers/net/wireless/ath/ath11k/peer.c
+++ b/drivers/net/wireless/ath/ath11k/peer.c
@@ -799,6 +799,12 @@ int ath11k_peer_delete(struct ath11k *ar
spin_lock_bh(&ar->ab->base_lock);

peer = ath11k_peer_find_by_addr(ar->ab, addr);
+ if (peer && peer-> pdev_idx == ar-> pdev_idx)
+ ath11k_peer_rhash_delete(ar->ab, peer);
+
+ if (!peer)
+ peer = ath11k_peer_find(ar->ab, vdev_id, addr);
+
if (peer) {
#ifdef CPTCFG_ATH11K_NSS_SUPPORT
peer->delete_in_progress = true;
@@ -867,13 +873,19 @@ 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) {
- spin_unlock_bh(&ar->ab->base_lock);
- return -EINVAL;
+ if (peer->vdev_id == param->vdev_id) {
+ spin_unlock_bh(&ar->ab->base_lock);
+ mutex_unlock(&ar->ab->tbl_mtx_lock);
+ return -EINVAL;
+ }
+ ath11k_peer_rhash_delete(ar->ab, peer);
}
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) {

0 comments on commit 096f9e9

Please sign in to comment.