linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH RFC v3 3/6] wifi: ath12k: switch to using wiphy_lock() and remove ar->conf_mutex
Date: Mon, 07 Oct 2024 17:47:50 +0300	[thread overview]
Message-ID: <87v7y43r6x.fsf@kernel.org> (raw)
In-Reply-To: <20240924092515.1049885-4-kvalo@kernel.org> (Kalle Valo's message of "Tue, 24 Sep 2024 12:25:12 +0300")

Kalle Valo <kvalo@kernel.org> writes:

> From: Kalle Valo <quic_kvalo@quicinc.com>
>
> Switch from using driver specific ar->conf_mutex to wiphy->mtx. The benefits are:
>
> * one lock less and simplified locking
>
> * possibility to use wiphy_work_queue() without other locks
>
> Most of the mac80211 ops are called within wiphy_lock(), most notable exception
> being tx op. This can be checked with lockdep_assert_wiphy() from
> net/mac80211/driver-ops.[ch] and I veried that by manually going through all
> the ops in ath12k_ops which had lockdep_assert_wiphy().
>
> The conversion was simple:
>
> * All conf_mutex lock() and unlock() calls which
>   already were called under wiphy_lock() I replaced with
>   lockdep_assert_wiphy().
>
> * The rest of conf_mutex calls I replaced with wiphy_lock() and wiphy_unlock().
>
> * All lockdep_asset_held(conf_mutex) calls I replaced with
>   lockdep_assert_wiphy().
>
> One exception was in ath12k_core_post_reconfigure_recovery() where the wiphy
> lock needs to be taken before hw_mutex to avoid a lockdep warning.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

[...]

> @@ -6432,7 +6411,8 @@ static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
>  	int i;
>  	int ret, vdev_id;
>  
> -	lockdep_assert_held(&ar->conf_mutex);
> +	lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
> +	lockdep_assert_wiphy(hw->wiphy);

The assert is twice, I'll fix that in v3.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2024-10-07 14:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-24  9:25 [PATCH RFC v3 0/6] wifi: ath12k: switch to using wiphy_lock() Kalle Valo
2024-09-24  9:25 ` [PATCH RFC v3 1/6] wifi: ath12k: fix atomic calls in ath12k_mac_op_set_bitrate_mask() Kalle Valo
2024-09-24  9:25 ` [PATCH RFC v3 2/6] wifi: ath12k: convert struct ath12k_sta::update_wk to use struct wiphy_work Kalle Valo
2024-09-24  9:25 ` [PATCH RFC v3 3/6] wifi: ath12k: switch to using wiphy_lock() and remove ar->conf_mutex Kalle Valo
2024-10-07 14:47   ` Kalle Valo [this message]
2024-09-24  9:25 ` [PATCH RFC v3 4/6] wifi: ath12k: cleanup unneeded labels Kalle Valo
2024-09-24  9:25 ` [PATCH RFC v3 5/6] wifi: ath12k: ath12k_mac_op_set_key(): remove exit label Kalle Valo
2024-09-24  9:25 ` [PATCH RFC v3 6/6] wifi: ath12k: ath12k_mac_op_sta_state(): clean up update_wk cancellation Kalle Valo

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=87v7y43r6x.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath12k@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).