ath12k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Lingbo Kong <quic_lingbok@quicinc.com>
To: Kalle Valo <kvalo@kernel.org>
Cc: Ramya Gnanasekar <quic_rgnanase@quicinc.com>,
	<ath12k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v2 3/5] wifi: ath12k: Fix Pdev id in HTT stats request for WCN7850
Date: Thu, 23 May 2024 22:04:34 +0800	[thread overview]
Message-ID: <ca9a3b1e-b115-4b28-b0fc-909baab5fdc4@quicinc.com> (raw)
In-Reply-To: <87ed9sbscj.fsf@kernel.org>



On 2024/5/23 20:55, Kalle Valo wrote:
> Lingbo Kong <quic_lingbok@quicinc.com> writes:
> 
>>>> +struct ath12k_vif *ath12k_mac_get_vif_up(struct ath12k_base *ab)
>>>> +{
>>>> +	struct ath12k *ar;
>>>> +	struct ath12k_pdev *pdev;
>>>> +	struct ath12k_vif *arvif;
>>>> +	int i;
>>>> +
>>>> +	for (i = 0; i < ab->num_radios; i++) {
>>>> +		pdev = &ab->pdevs[i];
>>>> +		ar = pdev->ar;
>>>> +		list_for_each_entry(arvif, &ar->arvifs, list) {
>>>> +			if (arvif->is_up)
>>>> +				return arvif;
>>>> +		}
>>>> +	}
>>>> +
>>>> +	return NULL;
>>>> +}
>>> I'm not seeing any protection here, is that on purpose?
>>
>> you means there need to add lockdep_assert_held(&ar->conf_mutex)?
> 
> I mean what's the locking design here? Is it safe to concurrectly access
> ab->pdevs and arvif->is_up?
> 

oh, i've seen other places use ar->conf_mutex to protect when accessing 
arvif->is_up.

but according to the ath12k_mac_get_vif_up()'s call stack, the 
ath12k_write_htt_stats_reset() and ath12k_open_htt_stats() have already 
executed mutex_lock(&ar->conf_mutex);

so it's best to add lockdep_assert_held(&ar->conf_mutex) here to 
determine whether conf_mutex is obtained.

/lingbo kong


  reply	other threads:[~2024-05-23 14:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10  5:08 [PATCH v2 0/5] wifi: ath12k: Add support to enable debugfs_htt_stats Ramya Gnanasekar
2024-05-10  5:08 ` [PATCH v2 1/5] " Ramya Gnanasekar
2024-05-10 19:53   ` Jeff Johnson
2024-05-21  7:49   ` Kalle Valo
2024-05-27 10:42     ` Ramya Gnanasekar
2024-05-10  5:08 ` [PATCH v2 2/5] wifi: ath12k: Add htt_stats_dump file ops support Ramya Gnanasekar
2024-05-10 19:53   ` Jeff Johnson
2024-05-21  7:53   ` Kalle Valo
2024-05-10  5:08 ` [PATCH v2 3/5] wifi: ath12k: Fix Pdev id in HTT stats request for WCN7850 Ramya Gnanasekar
2024-05-10 19:53   ` Jeff Johnson
2024-05-21  7:57   ` Kalle Valo
2024-05-23 12:34     ` Lingbo Kong
2024-05-23 12:55       ` Kalle Valo
2024-05-23 14:04         ` Lingbo Kong [this message]
2024-05-10  5:08 ` [PATCH v2 4/5] wifi: ath12k: Add support to parse requested stats_type Ramya Gnanasekar
2024-05-10 19:53   ` Jeff Johnson
2024-05-10  5:08 ` [PATCH v2 5/5] wifi: ath12k: Dump additional Tx PDEV HTT stats Ramya Gnanasekar
2024-05-10 19:54   ` Jeff Johnson
2024-05-21  8:00   ` Kalle Valo
2024-05-27  9:38     ` Ramya Gnanasekar
2024-05-28 11:06       ` Kalle Valo
2024-05-28 16:48         ` Ramya Gnanasekar
2024-05-31 18:00           ` Kalle Valo
2024-05-31 19:05             ` Ramya Gnanasekar
2024-05-21  7:40 ` [PATCH v2 0/5] wifi: ath12k: Add support to enable debugfs_htt_stats Kalle Valo
2024-05-27 10:44   ` Ramya Gnanasekar

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=ca9a3b1e-b115-4b28-b0fc-909baab5fdc4@quicinc.com \
    --to=quic_lingbok@quicinc.com \
    --cc=ath12k@lists.infradead.org \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_rgnanase@quicinc.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).