From: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
To: Jiale Yao <yaojiale02@163.com>,
Jeff Johnson <jjohnson@kernel.org>,
Michal Kazior <michal.kazior@tieto.com>,
Kalle Valo <kvalo@qca.qualcomm.com>,
linux-wireless@vger.kernel.org, ath10k@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/5] wifi: ath10k: avoid IDR mutation during TX cleanup
Date: Fri, 9 Oct 2026 18:31:28 -0700 [thread overview]
Message-ID: <2e271ffa-99b7-4c1f-9d17-96242a51d22b@oss.qualcomm.com> (raw)
In-Reply-To: <20261003092104.520135-2-yaojiale02@163.com>
On 10/3/2026 2:20 AM, Jiale Yao wrote:
> ath10k_htt_flush_tx_queue() walks pending_tx with idr_for_each().
> Its callback calls ath10k_txrx_tx_unref(), which removes the current
> entry from pending_tx through ath10k_htt_tx_free_msdu_id().
>
> idr_for_each() keeps radix-tree iterator state across the callback.
> Removing the current entry can therefore invalidate that state and
> make the remaining walk unsafe.
>
> Use idr_for_each_entry(), which starts a fresh lookup after each
> callback. The current entry can then be removed safely, while the
> following idr_destroy() continues to release the IDR itself.
>
> Fixes: 89d6d83565e9 ("ath10k: use idr api for msdu_ids")
> Signed-off-by: Jiale Yao <yaojiale02@163.com>
> ---
> drivers/net/wireless/ath/ath10k/htt_tx.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
> index e46f579d745d..9993c5a2f96c 100644
> --- a/drivers/net/wireless/ath/ath10k/htt_tx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
> @@ -535,8 +535,13 @@ void ath10k_htt_tx_destroy(struct ath10k_htt *htt)
>
> static void ath10k_htt_flush_tx_queue(struct ath10k_htt *htt)
> {
> + struct sk_buff *msdu;
> + int msdu_id;
> +
> ath10k_htc_stop_hl(htt->ar);
> - idr_for_each(&htt->pending_tx, ath10k_htt_tx_clean_up_pending, htt->ar);
> +
> + idr_for_each_entry(&htt->pending_tx, msdu, msdu_id)
> + ath10k_htt_tx_clean_up_pending(msdu_id, msdu, htt->ar);
my review agent notes:
**Actionable issue:** `ath10k_htt_tx_clean_up_pending` retains its old
`idr_for_each`-callback signature even though it's now called directly:
```c
static int ath10k_htt_tx_clean_up_pending(int msdu_id, void *skb, void *ctx)
```
The `skb` parameter is completely unused inside the function — it's not
read anywhere. Since this is a `static` function no longer used as a
callback, the signature should be cleaned up in the same patch:
- Remove the unused `void *skb` parameter
- Change `void *ctx` to `struct ath10k *ar`
- Make the return type `void` (the `return 0` is vestigial)
As-is, the call site `ath10k_htt_tx_clean_up_pending(msdu_id, msdu, htt->ar)`
passes `msdu` as a `void *` that the callee silently discards — confusing
for future readers.
> }
>
> void ath10k_htt_tx_stop(struct ath10k_htt *htt)
next prev parent reply other threads:[~2026-10-10 1:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-03 9:20 [PATCH v2 0/5] wifi: ath: avoid IDR mutation while iterating Jiale Yao
2026-10-03 9:20 ` [PATCH v2 1/5] wifi: ath10k: avoid IDR mutation during TX cleanup Jiale Yao
2026-10-10 1:31 ` Jeff Johnson [this message]
2026-10-03 9:20 ` [PATCH v2 2/5] wifi: ath11k: avoid IDR mutation during pending mgmt " Jiale Yao
2026-10-03 9:21 ` [PATCH v2 3/5] wifi: ath11k: avoid IDR mutation during vif " Jiale Yao
2026-10-03 9:21 ` [PATCH v2 4/5] wifi: ath12k: avoid IDR mutation during pending " Jiale Yao
2026-10-03 9:21 ` [PATCH v2 5/5] wifi: ath12k: avoid IDR mutation during vif " Jiale Yao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e271ffa-99b7-4c1f-9d17-96242a51d22b@oss.qualcomm.com \
--to=jeff.johnson@oss.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--cc=kvalo@qca.qualcomm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.com \
--cc=yaojiale02@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox