Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795031524; b=BCDd9YkvvdikSDCGi7fb4o4mU/W9SaXqIFzAZXaFVTKBVEBUZia9aqgsea0t1kX0XpEY BvLJ1WPnrWINR9wi3M9cHirOFQ7yEe9ZoYa9Kg3Xt1TPETPdnFkb52y6iT45CHww3GeQP ZjfogBfusfWrLWxkOGrLbNwJVi3aG2WKCkhY0BQDxIIxAHohuX8ssv17mhklZtl3trQem TYqrAYZtkSAEc9htIfSxnB4VJkdVxRJCt2I2aMsPxsPTng/ZDG5eaIQqiK5fqqq4CXIHE Q6Fxhb0HDk6avQObOUrP+ekkosttrvEu8iRwpN04ie4OgyEPcF+iX0fzMup6ssNu2Xw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795031524; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=U0YM6MJW+KAkPnPW5O9mHNKIk205mo9F0NTtJmlTwV4=; b=iaeDXsDEyC/KiXz0WTolfsbbUV6B+e7W2qMnGyoGbnq7LCwl38sa139LvlUetGIIl1ro /e8Umy0IQ6EIDSD9peKKo/QyPaEWFyj5TJLxBOFxsBYMJiHCXeekPHqhUYL+Y9Gt4IYq4 9mikJnbm5/p1Esm+lZEi8rMUY4jSUGxk5UTq19i4QDPeKCSw2yv4CxpysjFtN+FdtYjRx 8+egQsXiysrE3ja2LUmBgAeJtaiv6J0DDEIcyoExNb/ZoR4qW4nK214k7APkohZqihlnm 6Zk9wGT+LJPcwFLE4RBIl4UK+FvoWk1YHymCt2JZcrzujNF9swHkS+f2gwyBg07Nlkw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=AEEkPb+z; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C2DD606A31C; Wed, 18 Nov 2026 19:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=AEEkPb+z Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBAA91F000C4; Wed, 18 Nov 2026 19:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795031524; bh=U0YM6MJW+KAkPnPW5O9mHNKIk205mo9F0NTtJmlTwV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AEEkPb+zULz+ULWN9i5ncAVQbhirnq4nGIv3chJAkRamox7Rr30iiiGQ/zvmsQupa q4t4Sl4LTmPE6nLyuaOUJsfbXyuVTwaS9+8KPqDr2MLfAv2iVYsx3h4E1mvIQqBZS9 W8ZvgTgPXVQ3qdnzacOTSaowWqsRXnE363UMjT8Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jiale Yao , Baochen Qiang , Rameshkumar Sundaram , Jeff Johnson , Sasha Levin Subject: [PATCH 6.12 1088/1756] wifi: ath12k: avoid IDR mutation during vif mgmt TX cleanup Date: Wed, 18 Nov 2026 15:53:35 +0100 Message-ID: <20261118150053.501807365@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150007.957976754@linuxfoundation.org> References: <20261118150007.957976754@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiale Yao [ Upstream commit 4aa45334eb23d40bf31c43405daea9b73469f2a6 ] ath12k_mac_vdev_delete() walks txmgmt_idr with idr_for_each(), and its callback removes each entry belonging to the interface. Removing the current entry can invalidate the radix-tree iterator retained by idr_for_each(). Move the walk into a helper that uses idr_for_each_entry(). It performs a fresh lookup for every iteration, so each matching entry can be removed through the locked removal helper without retaining iterator state across the removal. Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Jiale Yao Reviewed-by: Baochen Qiang Reviewed-by: Rameshkumar Sundaram Link: https://patch.msgid.link/20261003092104.520135-6-yaojiale02@163.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath12k/mac.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 6a42c63307c8a..9f10eb7de3df2 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -5708,16 +5708,18 @@ int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx) return 0; } -static int ath12k_mac_vif_txmgmt_idr_remove(int buf_id, void *skb, void *ctx) +static void ath12k_mac_vif_txmgmt_cleanup(struct ath12k *ar, + struct ieee80211_vif *vif) { - struct ieee80211_vif *vif = ctx; - struct ath12k_skb_cb *skb_cb = ATH12K_SKB_CB(skb); - struct ath12k *ar = skb_cb->ar; - - if (skb_cb->vif == vif) - ath12k_mac_tx_mgmt_free(ar, buf_id); + struct ath12k_skb_cb *skb_cb; + struct sk_buff *skb; + int buf_id; - return 0; + idr_for_each_entry(&ar->txmgmt_idr, skb, buf_id) { + skb_cb = ATH12K_SKB_CB(skb); + if (skb_cb->vif == vif) + ath12k_mac_tx_mgmt_free(ar, buf_id); + } } static int ath12k_mac_mgmt_tx_wmi(struct ath12k *ar, struct ath12k_vif *arvif, @@ -6877,8 +6879,7 @@ static int ath12k_mac_vdev_delete(struct ath12k *ar, struct ieee80211_vif *vif) ath12k_peer_cleanup(ar, arvif->vdev_id); ath12k_arvif_put_cache(arvif); - idr_for_each(&ar->txmgmt_idr, - ath12k_mac_vif_txmgmt_idr_remove, vif); + ath12k_mac_vif_txmgmt_cleanup(ar, vif); ath12k_mac_vif_unref(&ab->dp, vif); ath12k_dp_tx_put_bank_profile(&ab->dp, arvif->bank_id); -- 2.53.0