mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix ieee80211_color_collision_detection_work() locking
@ 2024-09-24 19:28 Remi Pommarel
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Remi Pommarel @ 2024-09-24 19:28 UTC (permalink / raw)
  To: linux-wireless, linux-kernel
  Cc: Johannes Berg, Nicolas Cavallari, Nicolas Escande, Remi Pommarel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-24 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-24 19:28 [PATCH 0/2] Fix ieee80211_color_collision_detection_work() locking Remi Pommarel
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

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®