public inbox for ath12k@lists.infradead.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: Baochen Qiang <quic_bqiang@quicinc.com>,
	 <ath12k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] wifi: ath12k: avoid deadlock during regulatory update in ath12k_regd_update()
Date: Wed, 04 Sep 2024 19:47:47 +0300	[thread overview]
Message-ID: <87frqfcqmk.fsf@kernel.org> (raw)
In-Reply-To: <f613591f-bca5-4481-99e8-d294703f67dc@quicinc.com> (Jeff Johnson's message of "Wed, 4 Sep 2024 09:33:05 -0700")

Jeff Johnson <quic_jjohnson@quicinc.com> writes:

> On 8/29/2024 7:39 PM, Baochen Qiang wrote:
>
>> From: Wen Gong <quic_wgong@quicinc.com>
>> 
>> Running this test in a loop it is easy to reproduce an rtnl deadlock:
>> 
>> iw reg set FI
>> ifconfig wlan0 down
>> 
>> What happens is that thread A (workqueue) tries to update the regulatory:
>> 
>>     try to acquire the rtnl_lock of ar->regd_update_work
>> 
>>     rtnl_lock
>>     ath12k_regd_update [ath12k]
>>     ath12k_regd_update_work [ath12k]
>>     process_one_work
>>     worker_thread
>>     kthread
>>     ret_from_fork
>> 
>> And thread B (ifconfig) tries to stop the interface:
>> 
>>     try to cancel_work_sync(&ar->regd_update_work) in ath12k_mac_op_stop().
>>     ifconfig  3109 [003]  2414.232506: probe:
>> 
>>     ath12k_mac_op_stop [ath12k]
>>     drv_stop [mac80211]
>>     ieee80211_do_stop [mac80211]
>>     ieee80211_stop [mac80211]
>> 
>> The sequence of deadlock is:
>> 
>> 1. Thread B calls rtnl_lock().
>> 
>> 2. Thread A starts to run and calls rtnl_lock() from within
>>    ath12k_regd_update_work(), then enters wait state because the lock is owned by
>
> checkpatch complains that the commit description exceeds 75 columns
>
> at a minimum you should avoid exceeding 80 columns
>
> Kalle, do you want to reformat when you pull into pending?

Yes, I can reformat it in the pending branch. But I'm busy right now so
it might take a while.

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

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


      reply	other threads:[~2024-09-04 16:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-30  2:39 [PATCH] wifi: ath12k: avoid deadlock during regulatory update in ath12k_regd_update() Baochen Qiang
2024-09-04 16:33 ` Jeff Johnson
2024-09-04 16:47   ` Kalle Valo [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=87frqfcqmk.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath12k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_bqiang@quicinc.com \
    --cc=quic_jjohnson@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