From: Kalle Valo <kvalo@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>,
ath12k@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2 3/3] wifi: ath12k: Add lock to protect the hardware state
Date: Wed, 24 Apr 2024 15:16:50 +0300 [thread overview]
Message-ID: <87a5ljt0p9.fsf@kernel.org> (raw)
In-Reply-To: <0bfbb5549b48296e6219488d47caccd10e818700.camel@sipsolutions.net> (Johannes Berg's message of "Wed, 24 Apr 2024 11:52:22 +0200")
Johannes Berg <johannes@sipsolutions.net> writes:
> On Wed, 2024-04-24 at 12:50 +0300, Kalle Valo wrote:
>> Johannes Berg <johannes@sipsolutions.net> writes:
>>
>> > On Wed, 2024-04-24 at 12:39 +0300, Kalle Valo wrote:
>> > >
>> > > Exactly. Swithing to use wiphy_lock() definitely one of my longterm
>> > > goals in ath12k. I already started working on switching ath12k to use
>> > > wiphy_lock() but IIRC I got blocked by not being able to call
>> > > wiphy_delayed_work_cancel() without taking wiphy_lock.
>> >
>> > That's because I didn't want to have an async version, but theoretically
>> > we could have a version of it that just cancels the timer. If you don't
>> > hold the wiphy mutex already you could even wait for it to finish. It
>> > just adds more complexity there, and I was trying to make it all a lot
>> > more obvious :)
>>
>> Yeah, understandable. I think changing ath12k WMI event handling to use
>> wiphy_work makes sense, running them in tasklet context feels overkill.
>
> Maybe. Note that the wiphy lock _can_ create delays etc. here, if you're
> doing other configuration work at the same time, or similar. Though I
> guess eventually you need locking there anyway, to access the HW. So it
> can be a bit of a trade-off.
>
> I expect this will evolve over time even in mac80211, though so far we
> haven't seen any bad effect from it.
Good point. And now that I think of this more I don't think we can use
wiphy_work with WMI events as we are waiting some events while holding
wiphy_lock, that would end up as deadlock. So most likely we need to use
a normal workqueue with WMI events and take wiphy_lock manually in
certain cases. But I'll need to investigate more and do some
experiments.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2024-04-24 12:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 6:56 [PATCH v2 0/3] wifi: ath12k: Refactor the hardware recovery procedures Karthikeyan Periyasamy
2024-04-24 6:56 ` [PATCH v2 1/3] wifi: ath12k: Refactor the hardware recovery procedure Karthikeyan Periyasamy
2024-04-24 20:20 ` Jeff Johnson
2024-04-25 6:26 ` Karthikeyan Periyasamy
2024-04-24 6:56 ` [PATCH v2 2/3] wifi: ath12k: Refactor the hardware state Karthikeyan Periyasamy
2024-04-24 6:56 ` [PATCH v2 3/3] wifi: ath12k: Add lock to protect " Karthikeyan Periyasamy
2024-04-24 7:28 ` Johannes Berg
2024-04-24 9:39 ` Kalle Valo
2024-04-24 9:43 ` Johannes Berg
2024-04-24 9:50 ` Kalle Valo
2024-04-24 9:52 ` Johannes Berg
2024-04-24 12:16 ` Kalle Valo [this message]
2024-04-24 20:41 ` Jeff Johnson
2024-04-25 6:58 ` Karthikeyan Periyasamy
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=87a5ljt0p9.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=ath12k@lists.infradead.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_periyasa@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 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.