From: Nicolai Buchwitz <nb@tipi-net.de>
To: "Théo Lebrun" <theo.lebrun@bootlin.com>
Cc: "Conor Dooley" <conor.dooley@microchip.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Gregory CLEMENT" <gregory.clement@bootlin.com>,
"Benoît Monin" <benoit.monin@bootlin.com>,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH net-next] net: macb: move printk() calls out of bp->lock critical section
Date: Fri, 02 Oct 2026 11:53:01 +0200 [thread overview]
Message-ID: <c5df780e33d1b642a138070f5ff0c300@tipi-net.de> (raw)
In-Reply-To: <20260930-macb-irq-v1-1-8994a4c8f3bb@bootlin.com>
Hi Théo
On 30.9.2026 20:35, Théo Lebrun wrote:
> printk() call while bp->lock is acquired might be a bad idea:
>
> - It grows the spinlock atomic section.
>
> - If netconsole is active on the same interface (and we run on the
> queue's CPU), we risk a deadlock because macb_poll_controller()
> calls macb_interrupt() which grab bp->lock if an IRQ is pending.
>
> Three messages are changed:
>
> - In macb_tx_error_task(), defer netdev_err("halt tx timed out") call
> to after the critical section. Update the message to highlight it
> occurred in the past. Inherit the buffer exhaustion boolean variable
> name from the old code comment.
>
> - In macb_tx_error_task(), defer the netdev_err("TX buffers exhausted
> mid-frame") call out of the loop. This also means it goes from
> 1-per-error to 1-per-task-invocation.
>
> - In IRQ handling, move HRESP error printing out of
> macb_interrupt_misc() into macb_interrupt(). Again, it means we
> dedup error reporting if status is read multiple times in a row with
> HRESP bit set. This is fine as from past instances I've seen, this
> message spams our log if it occurs.
>
> Notice we *ignore* debug printks; if you are debugging MACB maybe don't
> use netconsole...
>
> The netconsole deadlock is theoretical & never reproduced.
>
> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
> ---
> This patch used to be part of context swapping V9.
> It got moved out as there aren't any dependency or relationship.
>
> Technically it is a fix, in practice I'm happy for it to go through
> net-next/main for more testing and it is a theoretical bugfix (as usual
> nowadays). Decided after seeing Jakub taking a similar patch into
> net-next this morning:
>
>> Since Linus is pushing back on our number of Fixes let's go for
>> net-next with similar fixes until the merge window
> https://lore.kernel.org/netdev/20260929184531.36ac3dc3@kernel.org/
>
> Changes since context swapping v9:
> - Rebase onto latest net-next/main (47a144672573).
> - Send patch standalone.
> - Simplify the commit message (it was a long and partially wrong
> rambling before). Also mention that it is a theoretical bugfix.
> - Link to v9:
> https://patch.msgid.link/20260812-macb-context-v9-0-7ddbf5f715e0@bootlin.com
> ---
> [...]
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Thanks,
Nicolai
prev parent reply other threads:[~2026-10-02 9:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 18:35 Théo Lebrun
2026-09-30 18:38 ` netdev-bot+sinfo
2026-09-30 18:55 ` Théo Lebrun
2026-10-02 9:53 ` Nicolai Buchwitz [this message]
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=c5df780e33d1b642a138070f5ff0c300@tipi-net.de \
--to=nb@tipi-net.de \
--cc=andrew+netdev@lunn.ch \
--cc=benoit.monin@bootlin.com \
--cc=conor.dooley@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gregory.clement@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tawfik.bayouk@mobileye.com \
--cc=theo.lebrun@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vladimir.kondratiev@mobileye.com \
/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®