All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kang Yang <quic_kangyang@quicinc.com>
To: Kalle Valo <kvalo@kernel.org>
Cc: <ath12k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v6 08/11] wifi: ath12k: allow specific mgmt frame tx while vdev is not up
Date: Thu, 7 Mar 2024 17:46:45 +0800	[thread overview]
Message-ID: <4536614a-7f4c-420f-b042-f71cf46ba08d@quicinc.com> (raw)
In-Reply-To: <87il31r26k.fsf@kernel.org>



On 2/7/2024 12:24 AM, Kalle Valo wrote:
> Kang Yang <quic_kangyang@quicinc.com> writes:
> 
>> In current code, the management frames must be sent after vdev is started.
>> But for P2P device, vdev won't start until P2P negotiation is done. So
>> this logic doesn't make sense for P2P device.
>>
>> Also use ar->conf_mutex to synchronize ar to avoid potential conflicts.
> 
> Please do locking changes in a separate followup patch, I removed this
> in the pending branch:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=d357dcb3cd0cd3bf57064dc673b5477d884454b3
> 
> I assume you are referring to ar->allocated_vdev_map and access to that
> indeed doesn't look consistent. Most of the places take conf->mutex but
> I see some places which it's accessed without the mutex, for example
> ath12k_mac_get_arvif_by_vdev_id() and ath12k_mac_get_ar_by_vdev_id().
> 


Hi, kalle:

I just take a look for ath12k_mac_get_arvif_by_vdev_id() and 
ath12k_mac_get_ar_by_vdev_id.

Both of them use rcu_read_lock(), so we don't need mutex_lock() anymore, 
right?

I also tried to add mutex_lock() for them, cannot work well:
[ 7804.291286] BUG: sleeping function called from invalid context at 
kernel/locking/mutex.c:585
[ 7804.291349] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, 
name: swapper/8
[ 7804.291358] preempt_count: 101, expected: 0
[ 7804.291366] RCU nest depth: 1, expected: 0
[ 7804.291374] 1 lock held by swapper/8/0:
……


> I recommend in the followup patch checking all the access to
> ar->allocated_vdev_map, fixing that if needed and adding documentation
> to struct ath12k::allocated_vdev_map how it's supposed to be protected.
> 


So i think the initial change is sufficient: just use mutex_lock() in
ath12k_mgmt_over_wmi_tx_work().


  parent reply	other threads:[~2024-03-07  9:47 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30  4:02 [PATCH v6 00/11] wifi: ath12k: P2P support for WCN7850 Kang Yang
2024-01-30  4:02 ` [PATCH v6 01/11] wifi: ath12k: fix broken structure wmi_vdev_create_cmd Kang Yang
2024-01-30 16:48   ` Jeff Johnson
2024-02-05 15:46   ` Kalle Valo
2024-02-07 15:07   ` Kalle Valo
2024-01-30  4:02 ` [PATCH v6 02/11] wifi: ath12k: fix incorrect logic of calculating vdev_stats_id Kang Yang
2024-01-30 16:51   ` Jeff Johnson
2024-02-05 15:33     ` Kalle Valo
2024-01-30  4:02 ` [PATCH v6 03/11] wifi: ath12k: change interface combination for P2P mode Kang Yang
2024-01-30 16:52   ` Jeff Johnson
2024-01-30  4:02 ` [PATCH v6 04/11] wifi: ath12k: add P2P IE in beacon template Kang Yang
2024-01-30 17:02   ` Jeff Johnson
2024-02-05 16:24     ` Kalle Valo
2024-02-05 16:17   ` Kalle Valo
2024-02-05 16:35     ` Jeff Johnson
2024-02-06  9:52       ` Kalle Valo
2024-01-30  4:02 ` [PATCH v6 05/11] wifi: ath12k: implement handling of P2P NoA event Kang Yang
2024-01-30 17:14   ` Jeff Johnson
2024-02-02 13:53   ` Kalle Valo
2024-02-02 16:25     ` Jeff Johnson
2024-02-06  2:21     ` Kang Yang
2024-02-06  9:56       ` Kalle Valo
2024-02-06 16:11   ` Kalle Valo
2024-02-06 18:17     ` Kalle Valo
2024-02-07 17:43       ` Jeff Johnson
2024-02-07  4:36     ` Kang Yang
2024-01-30  4:02 ` [PATCH v6 06/11] wifi: ath12k: implement remain on channel for P2P mode Kang Yang
2024-01-30 17:16   ` Jeff Johnson
2024-01-30  4:02 ` [PATCH v6 07/11] wifi: ath12k: change WLAN_SCAN_PARAMS_MAX_IE_LEN from 256 to 512 Kang Yang
2024-01-30 17:19   ` Jeff Johnson
2024-01-30  4:03 ` [PATCH v6 08/11] wifi: ath12k: allow specific mgmt frame tx while vdev is not up Kang Yang
2024-01-30 17:23   ` Jeff Johnson
2024-02-06 16:24   ` Kalle Valo
2024-02-07  4:44     ` Kang Yang
2024-03-07  9:46     ` Kang Yang [this message]
2024-01-30  4:03 ` [PATCH v6 09/11] wifi: ath12k: move peer delete after vdev stop of station for WCN7850 Kang Yang
2024-01-30 17:24   ` Jeff Johnson
2024-01-30  4:03 ` [PATCH v6 10/11] wifi: ath12k: designating channel frequency for ROC scan Kang Yang
2024-01-30 17:24   ` Jeff Johnson
2024-01-30  4:03 ` [PATCH v6 11/11] wifi: ath12k: advertise P2P dev support for WCN7850 Kang Yang
2024-01-30 17:25   ` Jeff Johnson
2024-02-05 15:40 ` [PATCH v6 00/11] wifi: ath12k: P2P " Kalle Valo
2024-02-07  6:50   ` Kang Yang

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=4536614a-7f4c-420f-b042-f71cf46ba08d@quicinc.com \
    --to=quic_kangyang@quicinc.com \
    --cc=ath12k@lists.infradead.org \
    --cc=kvalo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.