Linux wireless drivers development
 help / color / mirror / Atom feed
From: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
To: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Cc: ath11k@lists.infradead.org, ath12k@lists.infradead.org,
	jjohnson@kernel.org, linux-kernel@vger.kernel.org,
	linux-wireless@vger.kernel.org,
	pengdonglin <dolinux.peng@gmail.com>,
	"Toke Høiland-Jørgensen" <toke@toke.dk>
Subject: Re: [PATCH v5 4/4] wifi: ath12k: implement custom wake_tx_queue with flow control
Date: Thu, 13 Aug 2026 10:25:11 -0700	[thread overview]
Message-ID: <0bac4c07-6c78-478c-b3ec-1d897cdd8acf@oss.qualcomm.com> (raw)
In-Reply-To: <20260811111405.397112-1-jtornosm@redhat.com>

On 8/11/2026 4:14 AM, Jose Ignacio Tornos Martinez wrote:
> Keeping rcu_read_lock() for the entire function is intentional. 
> ath12k_wifi7_mac_op_tx() calls rcu_dereference() internally (on ahvif->link[]
> and ahsta->link[]), and with CONFIG_DEBUG_LOCK_ALLOC, rcu_dereference() checks
> lock_is_held(&rcu_lock_map) via rcu_read_lock_held(). 
> Only an explicit rcu_read_lock() sets rcu_lock_map and spin_lock_bh() does not,
> so releasing early would trigger lockdep warnings.

hmm, so some of the following commits are broken?
https://lore.kernel.org/all/20250916044735.2316171-1-dolinux.peng@gmail.com/

In particular the one that I merged into ath9k:
https://lore.kernel.org/all/20250916044735.2316171-15-dolinux.peng@gmail.com/

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c
b/drivers/net/wireless/ath/ath9k/xmit.c
index 0ac9212e42f7..4a0f465aa2fe 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1993,7 +1993,6 @@ void ath_txq_schedule(struct ath_softc *sc, struct
ath_txq *txq)

 	ieee80211_txq_schedule_start(hw, txq->mac80211_qnum);
 	spin_lock_bh(&sc->chan_lock);
-	rcu_read_lock();

 	if (sc->cur_chan->stopped)
 		goto out;
@@ -2011,7 +2010,6 @@ void ath_txq_schedule(struct ath_softc *sc, struct
ath_txq *txq)
 	}

 out:
-	rcu_read_unlock();
 	spin_unlock_bh(&sc->chan_lock);
 	ieee80211_txq_schedule_end(hw, txq->mac80211_qnum);
 }

I fed that into my review agent and it confirms your observation:
  The change works correctly on production kernels without
  CONFIG_DEBUG_LOCK_ALLOC. It will produce a false lockdep splat on debug
  kernels with CONFIG_PROVE_RCU because rcu_dereference() checks
  rcu_read_lock_held() which requires an explicit rcu_read_lock(), not just a
  spinlock.

I have a fixup for ath9k which does:
      171 -  ratetbl = rcu_dereference(sta->rates);
      171 +  ratetbl = rcu_dereference_bh(sta->rates);

Should ath12k also use rcu_dereference_bh()?

/jeff


      parent reply	other threads:[~2026-08-13 17:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 10:58 [PATCH v5 0/4] ath11k/ath12k: implement TX flow control Jose Ignacio Tornos Martinez
2026-08-07 10:58 ` [PATCH v5 1/4] wifi: ath11k: use queue mapping for WCN6750 ring selection Jose Ignacio Tornos Martinez
2026-08-07 10:58 ` [PATCH v5 2/4] wifi: ath11k/ath12k: remove skb parameter from get_ring_selector Jose Ignacio Tornos Martinez
2026-08-07 10:58 ` [PATCH v5 3/4] wifi: ath11k: implement custom wake_tx_queue with flow control Jose Ignacio Tornos Martinez
2026-08-08 18:42   ` Jeff Johnson
2026-08-11 10:42     ` Jose Ignacio Tornos Martinez
2026-08-07 10:58 ` [PATCH v5 4/4] wifi: ath12k: " Jose Ignacio Tornos Martinez
2026-08-08 19:29   ` Jeff Johnson
2026-08-11 11:14     ` Jose Ignacio Tornos Martinez
2026-08-13 16:23       ` Jeff Johnson
2026-08-13 17:25       ` Jeff Johnson [this message]

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=0bac4c07-6c78-478c-b3ec-1d897cdd8acf@oss.qualcomm.com \
    --to=jeff.johnson@oss.qualcomm.com \
    --cc=ath11k@lists.infradead.org \
    --cc=ath12k@lists.infradead.org \
    --cc=dolinux.peng@gmail.com \
    --cc=jjohnson@kernel.org \
    --cc=jtornosm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=toke@toke.dk \
    /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