[RFC] mac80211: Potential sleep in atomic context in __ieee80211_wake_txqs
From: Yunseong Kim
Date: Mon Aug 18 2025 - 12:57:05 EST
Hi,
I found a potential PREEMPT_RT issue I noticed in __ieee80211_wake_txqs()
static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac)
{
...
local_bh_disable();
spin_lock(&fq->lock);
...
}
This sequence of local_bh_disable() followed by spin_lock(). On an
RT-enabled system, spin_lock() is converted to a sleeping lock. Calling it
immediately after local_bh_disable() creates a situation where a sleeping
function is called from an atomic context, which will lead to a sleep in
atomic context if the lock is contended.
The conventional fix for this pattern is to replace the two lines with a
single, RT-safe call to spin_lock_bh(&fq->lock).
I wanted to bring this up for discussion before preparing a patch. Is this
a valid concern, and would a patch to correct this locking be the right
approach?
Thank you for your time and consideration.
Best regards,
Yunseong Kim