Article View: linux.kernel.netdev
Article #5746Re: [PATCH net 1/2] net: usb: cdc_ncm: don't enable BHs in tx_fixup under netpoll
From: Nicolai Buchwitz
Date: Tue, 20 Oct 2026 21:42
Date: Tue, 20 Oct 2026 21:42
41 lines
10033 bytes
10033 bytes
On October 20, 2026 9:16:55 AM GMT+02:00, Nicolai Buchwitz <nb@tipi-net.de> 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@visotia.com>
>Closes: https://lore.kernel.org/netdev/PRAP189MB185019A5A8D411482BB6E0CDA9982@PRAP189MB1850.EURP189.PROD.OUTLOOK.COM/
>Tested-by: Mikkel Eskildsen <mke@visotia.com>
>Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
>---
> 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 ...
> [...]
Technical Details
Message-ID:
<C3957DEA-5A45-4371-A7F2-72DB1F61C404@tipi-net.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349606-linux-kernel-netdev=dewy.ruReferences:
<20261020-cdc-ncm-netpoll-v1-0-682184384b49@tipi-net.de> <20261020-cdc-ncm-netpoll-v1-1-682184384b49@tipi-net.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349606-linux-kernel-netdev=dewy.ru From: nb@tipi-net.de (Nicolai Buchwitz) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 1/2] net: usb: cdc_ncm: don't enable BHs in tx_fixup under netpoll Date: Tue, 20 Oct 2026 23:42:26 +0200 Organization: Usenet Network Message-ID: <C3957DEA-5A45-4371-A7F2-72DB1F61C404@tipi-net.de> References: <20261020-cdc-ncm-netpoll-v1-0-682184384b49@tipi-net.de> <20261020-cdc-ncm-netpoll-v1-1-682184384b49@tipi-net.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="3972886"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:6jI97m53HLDrS6G8eJReC8JD5yE= sha256:tcwbq/mR3lLUOFWgU6CESZAOWSL3kC7EzNe1EA1SHTk= sha1:bKRJ9M4bFZx22lMBtwuBswL3evU= sha256:kzRJDCYvkCZ9mS31HEKMWTD4LMJtqtVBX41v8CPKvIw= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id A0726110E70; Wed, 21 Oct 2026 00:47:23 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.949 X-Spam-Status: No, score=-1.949 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=tipi-net.de X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q7ahJkGOj4dU; Wed, 21 Oct 2026 00:47:20 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349606-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id B6BBD110E6D; Wed, 21 Oct 2026 00:47:11 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 0615437E39; Tue, 20 Oct 2026 21:42:52 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792532571; b=NMqO06tW2rcjUQBxtLwHFNBhog0iApHGf+Kiqfs6e7oOLf5OSW6rt7c9alDBP8jZuYq8 hZgy38UBu3V6wKy9BiSriW1CxCsNAQuarKecz8hx6AjfLk+rF+Y7d7PRZOQ+Hwkg5Sxim 8I9UAn1BotB9mdgr3i7tb/q3b9BRXqS6raQGiKrPMf966Yg1sD5MFyXMk+dVu2kkfzpoQ v1hyVEdTClMb0TeNS9RvaY3OInEyyNxWLIo7U5KcxKxXEdiSCQgcg3UXQGMRkaYdS+erJ bcs87++cNYDr4I9v3kgC6QC4U91fsaE1l50xU98AkguZvbA6geWQwuppf1acu0gBh9w== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792532571; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:Date: From:To:CC:Subject:User-Agent:In-Reply-To:References:Message-ID: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=EZoVk953tdpmRXAVkVQyjR2UGZ+9j5515QF7WBP1WBk=; b=fiJN0nog3YhMWUcGDWFOXsLt9YPje0EV22kzjMUQnJAGa1xqigdpd2tv5YxWCeLQlBQy ptykw2xu55ctW2UKxUT2A3hiBKC6IMhWI0jdVpR5Pm/9a7snBB4+d3KUxvGfK1dCrD61R tTq4/9eqY9qI1JixG5/UDQKdKHaCIB3kPasyLB1UE0fn7iM+xOxNMk398SSTD2RPnDOPh UOFUNKeOYjp7drYxBgrAiYiGFG9hdaHRyMOzak3hRMhz8q7XG25j33IB9vUZj/+z+lD11 62jThMSlws55oebnae/TsZMzYb5a/MoP9bfEhz9+8+Z4Gaf8HPrNNR77x3IbwegnDYA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=Ws+kLsKd; dmarc=none header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 570A8606A31E; Tue, 20 Oct 2026 21:42:51 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=Ws+kLsKd X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792532555; b=iNO963ySAQuIDzSLk/FEGi2Bi22Mwi5xZd+KoHrmG84igvRNSvMDsE5JX+GNprrNWdVB GlSu/BMIfIFZKTHtSGH1ritlK7Y2PJoupgC9MJa0stylzm+j3043mcTCuXK6hWF3bW8dA h7ltgfv7+hIYzNYyd3sjeoUASy9g4uPSjB5L1ruh3wuI2UV0y7b5CttLh9YACNTDojde6 TLPo25cCd53J34IFUMbXjomWLqBJFJzfL6KXRj2Hme3V7WTeRaet0gE0fwBl+8Z+YtFKG ML8i3x75oSqWN/GcmVhCfR2MC+843aE9A9oabxQGuLHpu+ABHSU+lp+FJ382J4s2NOA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792532555; h=DMARC-Filter:Received:DKIM-Signature:Date:From:To:CC:Subject: User-Agent:In-Reply-To:References:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=EZoVk953tdpmRXAVkVQyjR2UGZ+9j5515QF7WBP1WBk=; b=C06ZRKcEELizGEUfddMax7e8qqWLDkzuSmah4+05wPD/N4UgRVjsaO+R6CaZ0HfoOJ+H Nki76xmsifdKuCtEQTEa8BgHlxu2VD9o9RV+5rwlEf1wvRhqyiSoeg1nVZJRWp3oqMavQ Dm/kzH47JYjZOhJky0J0iwDVQD1IOsKO29DZ/4trO0tNYzjmrxLxpE+KKeQdfTmsAsUPz P2r73rpciogEtiAYvmHct/bPRawvhlg/M2Kskk7/CYDeTfsclUQaC12IiEFL7P7Q7PnJr lYrSQfaRWByUXcR7N3eTUG8pYrUQb8RkipU33PDffDDZpk8k13527PXOsY6jZDWBbQA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=Ws+kLsKd; arc=none smtp.remote-ip=194.13.80.246 X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84D9F606A319; Tue, 20 Oct 2026 21:42:32 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 84D9F606A319 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1A89AA161F; Tue, 20 Oct 2026 23:42:26 +0200 (CEST) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1792532549; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=EZoVk953tdpmRXAVkVQyjR2UGZ+9j5515QF7WBP1WBk=; b=Ws+kLsKdofv/SfwkZRiBLhQLma9RauatD4xtoDQ9QDvSn0F5ryDf0YijpfI6Wvg8ZQV5RB j3VeYj2rqX4Yhxa/DJhf6INhNVyjMs9LI/K26NERS5DEYu1guli7OnTrfHeWPyC7+ubEo7 JnROMakMNrMn6HaRt6H5tmj2qb0pRMc6Js5NajLCPZvtjTO9uVGopp1nfL3LSHCska2hd/ tKO3okH0wkDsTUbTYiEpmnC4aDDljhSleVGOhe9CX7bGHV+oeP+jiRyZHm6eThm1QWpTbi p1IefVOjmDDh3+RWnTBSWjATy9oRZhTiRijuBFGVqHXHhabRe+s4GzSwncbhWw== X-CC: Breno Leitao <leitao@debian.org>, linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Mikkel Eskildsen <mke@visotia.com> X-User-Agent: Thunderbird for Android X-In-Reply-To: <20261020-cdc-ncm-netpoll-v1-1-682184384b49@tipi-net.de> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Last-TLS-Session-Version: TLSv1.3