Re: [PATCH net 1/2] net: usb: cdc_ncm: don't enable BHs in tx_fixup under netpoll

From: Nicolai Buchwitz

Date: Tue Oct 20 2026 - 17:42:44 EST




On October 20, 2026 9:16:55 AM GMT+02:00, Nicolai Buchwitz <nb@xxxxxxxxxxx> wrote:
>netpoll holds the txq lock and calls ndo_start_xmit() with IRQs off but
>BHs on. The spin_unlock_bh() in cdc_ncm_tx_fixup() then runs pending
>softirqs. If one of them transmits, it spins on the txq lock that
>netpoll holds. With netconsole on a cdc_ncm device this ends in a soft
>or hard lockup.
>
>Use spin_lock_irqsave(), which is safe both under netpoll and on the
>normal xmit path.
>
>Fixes: c84ff1d6dff3 ("cdc_ncm: reduce driver latency in the data path")
>Reported-by: Mikkel Eskildsen <mke@xxxxxxxxxxx>
>Closes: https://lore.kernel.org/netdev/PRAP189MB185019A5A8D411482BB6E0CDA9982@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
>Tested-by: Mikkel Eskildsen <mke@xxxxxxxxxxx>
>Signed-off-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
>---
> drivers/net/usb/cdc_ncm.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
>index 35db38cb3e4a2..b579442f4a272 100644
>--- a/drivers/net/usb/cdc_ncm.c
>+++ b/drivers/net/usb/cdc_ncm.c
>@@ -1524,6 +1524,7 @@ cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
> {
> struct sk_buff *skb_out;
> struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
>+ unsigned long irqflags;

x-mas, argh ... broken before and after, will fix this in v2.

But let's hear what/if clashiko will add, before I mark it cr in pwbot ...

> [...]