From nobody Mon Feb 9 03:16:05 2026 Received: from mailgw03.horizon.ai (mailgw03.horizon.ai [42.62.85.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 914D52E8DFC for ; Fri, 9 Jan 2026 07:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=42.62.85.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767942163; cv=none; b=hYixLEODeun4CFXAL7miEoM1EK7xs7tclqWkYksBN+j8E+e/iiJFiD4or5MrCoIUK3o31wnBeKbDpO9q8hbFF+PP1fy5MKQay7a/5Y4oUFESWtaRzj7h6dCSJBapMuYcBpuwVWHM/pWFc45OyeMaaJ1B6hutt07uyZSpJX6G+fY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767942163; c=relaxed/simple; bh=Y64n2Qv//UyAC/rV14nyXSTMyZ+t04xMntNuy1XuNfk=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=jP1rVUzYdB2JNIdlbyBm5zkrGcbylj1zPk2SwDlIgMwDKaKexluuAbaxdAztyAVUq/p308uh13gj18JDvdmLOq2SOZOzVVgumSMmYGMR/V3Igqg/iMHoaRdYHil/uBMkEaODaH23JS+vWWMhHFkHoywz8AAa2G5YkPazKaRo7Jg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=horizon.auto; spf=pass smtp.mailfrom=horizon.auto; dkim=pass (1024-bit key) header.d=horizon.auto header.i=@horizon.auto header.b=tMGgv0oR; arc=none smtp.client-ip=42.62.85.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=horizon.auto Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=horizon.auto Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=horizon.auto header.i=@horizon.auto header.b="tMGgv0oR" DKIM-Signature: v=1; a=rsa-sha256; d=horizon.auto; s=horizonauto; c=relaxed/simple; q=dns/txt; i=@horizon.auto; t=1767942145; x=2631855745; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Y64n2Qv//UyAC/rV14nyXSTMyZ+t04xMntNuy1XuNfk=; b=tMGgv0oRIFe+lRHjoOsdO5TBGTRhAuzGlRkQpWxSkr//Rgo9tDxucEbqo9Ct6EUs 3Lw5QiMyaWmHk0MsAxebLmCMVAAZEHZ3IQWOdgu4voHqnJqHLfD7uEApmxob9MVD qIPmV31orHDJwoU3gf76mZaWsy9feX7kVqbQx3XJNBg=; X-AuditID: 0a0901b2-df5da70000001406-04-6960a8010822 Received: from mailgw03.horizon.ai ( [10.9.15.111]) by mailgw03.horizon.ai (Anti-spam for msg) with SMTP id C0.2C.05126.108A0696; Fri, 9 Jan 2026 15:02:25 +0800 (HKT) Received: from wangtao-VirtualBox.hobot.cc (10.9.0.252) by exchange002.hobot.cc (10.9.15.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.27; Fri, 9 Jan 2026 15:02:24 +0800 From: Tao Wang To: , , , , , , , , , , CC: , , Tao Wang Subject: [PATCH net Resend] net: stmmac: fix transmit queue timed out after resume Date: Fri, 9 Jan 2026 15:02:11 +0800 Message-ID: <20260109070211.101076-1-tao03.wang@horizon.auto> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: exchange004.hobot.cc (10.9.15.112) To exchange002.hobot.cc (10.9.15.111) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRmVeSWpSXmKPExsXCxcmfr8u4IiHTYP5UU4ufL6cxWix/sIPV Ys75FhaLR/0n2CwubOtjtVjYtoTF4vKuOWwWL19vY7Y4tkDM4tvpN4wWl/onMjlwe1y+dpHZ Y96aao8tK28yeTzt38rusWlVJ5vHzh2fmTze77vK5vF5k1wARxSXTUpqTmZZapG+XQJXxqmn +9kLDglVbNnxhqWB8Rh/FyMnh4SAicSJpknsILaQwEpGifON7l2MXED2c0aJS7ceMYIk2AQ0 JO5OvcYCkhARWMwk0Xl6KhNIglkgVWLv7p/MILawQJDE1oeHWEFsFgEViaMzNgA1cHDwCthK fOhhgVgmL7H/4Fmwcl4BQYmTM5+wQIyRl2jeOpsZwpaQOPjiBTPEQSoSzSfns0P0ykm83rCf DcKOlfj2YgbLBEaBWUhGzUIyahaSUQsYmVcxCucmZuaklxsY62XkF2VW5efpJWZuYgTHCOOm HYxLFnzUO8TIxMF4iFGCg1lJhLdZMD5TiDclsbIqtSg/vqg0J7X4EKM0B4uSOK+2YlymkEB6 YklqdmpqQWoRTJaJg1OqgSmB/aZb6obw65sXzW3n01K5v9xD6OxBzp17l+iynn01dWpBGo+q hNUFlq/Ci/ce/HlP+liB5cmf3PcteYRWb5tR/m/DAnXD5muODW4xMxhFXOvarnflZUyLvtPX +/rUaYdtG4/6pmU63LtXa3Rg1Zfd926pFHL1H/hpq/ciedmTA99z2AuWp/bam2Rzhh7lKmHv Wn5aQ0bcmL28Z9slj92bjUwz7yQ+/lPDlXn2p9sTli1z3q7fEmY60fHW/Crefy9NkxQZUp2E t/Fu4VvoZt1t+f3U6SWME5lrDYsXOub//hJ//4SWXPMCW+HIvKPin9dcYV/by7VeZdbLLJUN E3P2WvTtXbd2WoiM4En5lcuUWIozEg21mIuKEwG9m0ZvAAMAAA== Content-Type: text/plain; charset="utf-8" after resume dev_watchdog() message: "NETDEV WATCHDOG: CPU: x: transmit queue x timed out xx ms" The trigging scenario is as follows: When the TSO function sets tx_skbuff_dma[tx_q->cur_tx].last_segment =3D true , and the last_segment value is not cleared in stmmac_free_tx_buffer after resume, restarting TSO transmission may incorrectly use tx_q->tx_skbuff_dma[first_entry].last_segment =3D true for a new TSO packet. When the tx queue has timed out, and the emac TX descriptor is as follows: eth0: 221 [0x0000000876d10dd0]: 0x73660cbe 0x8 0x42 0xb04416a0 eth0: 222 [0x0000000876d10de0]: 0x77731d40 0x8 0x16a0 0x90000000 Descriptor 221 is the TSO header, and descriptor 222 is the TSO payload. In the tdes3 (0xb04416a0), bit 29 (first descriptor) and bit 28 (last descriptor) of the TSO packet 221 DMA descriptor cannot both be set to 1 simultaneously. Since descriptor 222 is the actual last descriptor, failing to set it properly will cause the EMAC DMA to stop and hang. To solve the issue, set last_segment to false in stmmac_free_tx_buffer: tx_q->tx_skbuff_dma[i].last_segment =3D false; Set last_segment to false in stmmac_tso_xmit, and do not use the default value: tx_q->tx_skbuff_dma[first_entry].last_segment =3D false; This will prevent similar issues from occurring in the future. Signed-off-by: Tao Wang --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index b3730312aeed..d786ac3c78f7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1653,6 +1653,7 @@ static void stmmac_free_tx_buffer(struct stmmac_priv = *priv, =20 tx_q->tx_skbuff_dma[i].buf =3D 0; tx_q->tx_skbuff_dma[i].map_as_page =3D false; + tx_q->tx_skbuff_dma[i].last_segment =3D false; } =20 /** @@ -4448,6 +4449,7 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *sk= b, struct net_device *dev) if (dma_mapping_error(priv->device, des)) goto dma_map_err; =20 + tx_q->tx_skbuff_dma[first_entry].last_segment =3D false; stmmac_set_desc_addr(priv, first, des); stmmac_tso_allocator(priv, des + proto_hdr_len, pay_len, (nfrags =3D=3D 0), queue); --=20 2.34.1