Skip to contentSkip to conversation

mac80211: Potential sleep in atomic context in __ieee80211_wake_txqs

RFC Yunseong Kim 2 participants 2 messages Aug 18, 2025 – Aug 19, 2025 Real-time Linux (PREEMPT_RT)

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 1 line · Yunseong Kim

Hi,

Hi,

Quoted 11 lines

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

As explained in the previous mail regarding for
inet_twsk_hashdance_schedule(), this is fine.

Quoted 2 lines

Best regards,
Yunseong Kim

Sebastian