From: Remi Pommarel <repk@triplefau.lt>
To: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Johannes Berg <johannes@sipsolutions.net>,
Nicolas Cavallari <Nicolas.Cavallari@green-communications.fr>,
Nicolas Escande <nescande@freebox.fr>,
Remi Pommarel <repk@triplefau.lt>
Subject: [PATCH 0/2] Fix ieee80211_color_collision_detection_work() locking
Date: Tue, 24 Sep 2024 21:28:03 +0200 [thread overview]
Message-ID: <20240924192805.13859-1-repk@triplefau.lt> (raw)
Call to ieee80211_color_collision_detection_work() needs wiphy lock to be
held. This lock cannot be taken directly in the delayed work because it
would cause a potential deadlock. Indeed ieee80211_link_stop() is calling
cancel_delayed_work_sync() with the lock held. To avoid such deadlock one
can use a wiphy delayed work instead.
Thus this patchset convert ieee80211_color_collision_detection_work() to
use wiphy delayed work instead of classical delayed work. But because
this work is used to ratelimit cfg80211_obss_color_collision_notify() a
way to tell if it has already been scheduled is needed as discussed in
[0]. In this thread three different solutions has been considered:
- Implementing wiphy_delayed_work_pending() to detect if work can be
queued without postponing a previous schedule
- Using a __ratelimit or an equivalent to queue the work
- Modifying wiphy_delayed_work_queue() to mimic queue_delayed_work() by
not queuing the work if already queued (while also possibly having to
add wiphy_delayed_work_mod() for those who need the mod_delayed_work()
behavior).
This patchset implement the first solution.
[0]: https://lore.kernel.org/linux-wireless/D4A40Q44OAY2.W3SIF6UEPBUN@freebox.fr/
Remi Pommarel (2):
wifi: cfg80211: Add wiphy_delayed_work_pending()
wifi: mac80211: Convert color collision detection to wiphy work
include/net/cfg80211.h | 44 ++++++++++++++++++++++++++++++++++++++
net/mac80211/cfg.c | 17 ++++++++-------
net/mac80211/ieee80211_i.h | 5 +++--
net/mac80211/link.c | 7 +++---
net/wireless/core.c | 7 ++++++
5 files changed, 67 insertions(+), 13 deletions(-)
--
2.46.0
next reply other threads:[~2024-09-24 19:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 19:28 Remi Pommarel [this message]
2024-09-24 19:28 ` [PATCH 1/2] wifi: cfg80211: Add wiphy_delayed_work_pending() Remi Pommarel
2024-09-24 19:28 ` [PATCH 2/2] wifi: mac80211: Convert color collision detection to wiphy work Remi Pommarel
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=20240924192805.13859-1-repk@triplefau.lt \
--to=repk@triplefau.lt \
--cc=Nicolas.Cavallari@green-communications.fr \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nescande@freebox.fr \
/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
all inboxes | Powered by JetHome®