mirror of https://lore.kernel.org/ath12k/
 help / color / mirror / Atom feed
From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
To: jeff.johnson@oss.qualcomm.com
Cc: ath11k@lists.infradead.org, ath12k@lists.infradead.org,
	jjohnson@kernel.org, jtornosm@redhat.com,
	linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v5 4/4] wifi: ath12k: implement custom wake_tx_queue with flow control
Date: Tue, 11 Aug 2026 13:14:05 +0200	[thread overview]
Message-ID: <20260811111405.397112-1-jtornosm@redhat.com> (raw)
In-Reply-To: <0b72231d-59f8-49bf-82a0-76d2c7862729@oss.qualcomm.com>

Thanks for the review, Jeff.

> Tested-on missing

Ok, I will add it in v6

> NAK, must be EXPORT_SYMBOL()
> The ath12k code was contributed under the license:
> // SPDX-License-Identifier: BSD-3-Clause-Clear

I did it in an automatic way, I will fix it in v6

>> +	rcu_read_lock();
> 
> does this lock really need to be held for the entire function including the tx
> loop?
> 
>> +
>> +	arvif = rcu_dereference(ahvif->link[link_id]);
>> +	if (!arvif || !arvif->ar) {
>> +		rcu_read_unlock();
>> +		return;
>> +	}
>> +
>> +	ar = arvif->ar;
>> +	dp = ar->ab->dp;
>
> or is it sufficient to cache these values and then rcu_read_unlock() here?
> my LLM reviewer seems to think that would be sufficient
>
> note the spinlock in the while loop will cause the RCU read lock to be held
> when invoking mac_op_tx(), satisfying the RCU lock requirement there.

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.

> using guard(spinlock_bh)(&tx_ring->wake_tx_lock) would eliminate the need for
> all the spin_unlock_bh(&tx_ring->wake_tx_lock) calls

Better, I will use it in v6

>> +
>> +		spin_lock(&tcl_ring->lock);
>
> seems this should be spin_lock_bh() to align with all other callers in the driver.

The outer spin_lock_bh(&tx_ring->wake_tx_lock); already disables BH, so
spin_lock() for the inner tcl_ring->lock is correct and sufficient. Using
spin_lock_bh() would redundantly disable BH again.

Best regards
Jose Ignacio



      reply	other threads:[~2026-08-11 11:14 UTC|newest]

Thread overview: 9+ 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 [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=20260811111405.397112-1-jtornosm@redhat.com \
    --to=jtornosm@redhat.com \
    --cc=ath11k@lists.infradead.org \
    --cc=ath12k@lists.infradead.org \
    --cc=jeff.johnson@oss.qualcomm.com \
    --cc=jjohnson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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