Re: [PATCH] wifi: brcmfmac: avoid sleeping tx locks in netpoll contextg

From: Karl Mehltretter

Date: Thu Oct 01 2026 - 19:42:31 EST


On Thu, Oct 01, 2026 at 09:57:55AM +0100, Sebastian Andrzej Siewior wrote:
> On 2026-09-30 20:54:17 [+0200], Karl Mehltretter wrote:
> > This fixes the direct SDIO transmit path used by fcmode=0. Modes 1 and 2
> > take the FWS lock first and need a separate change.
>
> Is this the only affected driver?

I also reproduced a sleeping-lock warning with 8139cp on PREEMPT_RT
using QEMU's RTL8139C+ device. Enabling a dynamic netconsole target caused
the printer thread to enter cp_start_xmit() with hard interrupts disabled:

BUG: sleeping function called from invalid context
in_atomic(): 0, irqs_disabled(): 1, pid: 107, name: pr/netcon0
hardirqs last disabled at netpoll_send_skb+0x1c8/0x3d0
rt_spin_lock
cp_start_xmit+0x31/0x8b6 [8139cp]
netpoll_start_xmit+0x18e/0x260
netpoll_send_skb+0x37a/0x3d0
netconsole_write+0x56d/0x820

That was one reproduction on the netdev base a7bfaba4823e. I have not
established how many drivers are affected.

Source inspection also identified 8139too and macb as candidates: their
transmit paths take ordinary spinlock_t locks. I have not reproduced the
warning with either driver.

The earlier netpoll/NBCON discussion concerns NAPI polling and
scheduler-lock deadlocks, rather than this driver-lock warning:

https://lore.kernel.org/linux-rt-devel/20260618111554.2n0pP_O9@xxxxxxxxxxxxx/

> Do you have maybe a backtrace?
>

This is the original Pi 400 report on 7.3-rc3 with PREEMPT_RT. That kernel
also had unrelated allocation-test patches applied. DEBUG_ATOMIC_SLEEP
was disabled, so this report is the BH-disable warning:

DEBUG_LOCKS_WARN_ON(this_cpu_read(softirq_ctrl.cnt))
WARNING: kernel/softirq.c:199 at __local_bh_disable_ip+0xd8/0x200
CPU#0: pr/netcon0/769
Call trace:
__local_bh_disable_ip+0xd8/0x200
brcmf_sdio_bus_txdata+0x90/0x2b0 [brcmfmac]
brcmf_proto_bcdc_txdata+0x90/0xb0 [brcmfmac]
brcmf_proto_bcdc_tx_queue_data+0x60/0xa0 [brcmfmac]
brcmf_netdev_start_xmit+0x164/0x390 [brcmfmac]
netpoll_start_xmit+0x160/0x218
netpoll_send_skb+0x208/0x2b0
netpoll_send_udp+0x298/0x478
netconsole_write+0x440/0x7a0
netconsole_write_basic+0x20/0x40
nbcon_emit_next_record+0x208/0x2a8
nbcon_emit_one+0xc8/0x110
nbcon_kthread_func+0x184/0x210

Thanks,
Karl