Re: [PATCH ath-next] wifi: ath9k_htc: count a frame as queued before it is sent
From: Toke Høiland-Jørgensen
Date: Mon Nov 16 2026 - 11:54:32 EST
On Wed, 11 Nov 2026 22:59:02 +0100, Mehmet Fide <mehmet.fide@xxxxxxxxx> wrote:
> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
> index b46be3682f21..9467b8e512a6 100644
> --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
> @@ -888,17 +888,21 @@ static void ath9k_htc_tx(struct ieee80211_hw *hw,
> [ ... skip 14 lines ... ]
>
> clear_slot:
> + spin_lock_bh(&priv->tx.tx_lock);
> + priv->tx.queued_cnt--;
> + spin_unlock_bh(&priv->tx.tx_lock);
> + ath9k_htc_check_wake_queues(priv);
Hmm, so this results in taking the lock twice, once for decrementing and once
for checking. How about we define a __ath9k_htc_check_wake_queues() function which
takes a boolean "decrement" as the second parameter, and does the decrement
under the lock if set? Then we can turn ath9k_htc_check_wake_queues(priv) into a
wrapper which just calls __ath9k_htc_check_wake_queues(priv, false).
-Toke
--