mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Karl Mehltretter <kmehltretter@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	Arend van Spriel <arend.vanspriel@broadcom.com>,
	Clark Williams <clrkwllms@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com,
	linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev,
	stable@vger.kernel.org
Subject: Re: [PATCH] wifi: brcmfmac: avoid sleeping tx locks in netpoll contextg
Date: Fri, 9 Oct 2026 18:00:15 +0200	[thread overview]
Message-ID: <20261009160015.9YCN8Lt-@linutronix.de> (raw)
In-Reply-To: <ar7vLt5kQ2HJoJY9@gmail.com>

On 2026-10-02 01:41:51 [+0200], Karl Mehltretter wrote:
> 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.

I just replied to the netconsole thread where I did suggest to lift the
local_irq_save() part. This would obsolete this.

> 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@linutronix.de/

There was no fan club behind this change and PeterZ hated it so I
dropped it.
But this deadlock should not happen with nbcon or do I mix up things?

> > 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:
…

I don't mind if you have something to optimise the driver. But as far as
the netconsole part goes, I would try to kill it at the upper level so
the driver is not affected.

> Thanks,
> Karl

Sebastian

  reply	other threads:[~2026-10-09 16:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 18:54 [PATCH] wifi: brcmfmac: avoid sleeping tx locks in netpoll context Karl Mehltretter
2026-10-01  7:57 ` Sebastian Andrzej Siewior
2026-10-01 23:41   ` [PATCH] wifi: brcmfmac: avoid sleeping tx locks in netpoll contextg Karl Mehltretter
2026-10-09 16:00     ` Sebastian Andrzej Siewior [this message]
2026-10-04 12:29 ` [PATCH] wifi: brcmfmac: avoid sleeping tx locks in netpoll context Arend van Spriel
2026-10-06  4:18   ` Karl Mehltretter
2026-10-06  8:27     ` Arend van Spriel
2026-10-09  7:30       ` Karl Mehltretter
2026-10-09 11:46         ` Arend van Spriel

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=20261009160015.9YCN8Lt-@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211@lists.linux.dev \
    --cc=clrkwllms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kmehltretter@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    /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®