From nobody Mon Feb 9 03:30:46 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 72FCF31197F for ; Fri, 16 Jan 2026 09:39:49 +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=1768556394; cv=none; b=rDxyvjs6uyB8NqrYYfxwHcsloF36RJrO8+XK1iN6DXUUsy5lqnqT5BY+gOUck8E1+Dc5OKHGdAeSCVzh3N5sFKZgSxkZ2oQzbgpqwKZ7ag004UXryLh+DyLLV7y7a8ltqGNT+9jjD8mh9MsQiarIvm6NUMKpnFYvncjf2tlHEZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768556394; c=relaxed/simple; bh=a4gfC11GKOCqy9sxLvnmGbXidmAXWWeVuphhN34RDLA=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=UEacwS3e4kGB4Ric9c4g5zzp/sNgOBRvAH9518XxLcO1TJP3WmauHsOIrBsYnK+dZmmbPndpZNEWDXTCH2tg+bqEe9cIfay40Zf85W/2EFdAx/2wlfOs6WYHD92lkY5qZfVzRWayZEAUDtWFBO5kE+G8emGUiFhYZFwcySEGywk= 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=VmTeKKYY; 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="VmTeKKYY" DKIM-Signature: v=1; a=rsa-sha256; d=horizon.auto; s=horizonauto; c=relaxed/simple; q=dns/txt; i=@horizon.auto; t=1768556386; x=2632469986; 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=a4gfC11GKOCqy9sxLvnmGbXidmAXWWeVuphhN34RDLA=; b=VmTeKKYYbQZ/V14t568JLOTRp+3Rz3NThRX7O4qfzDpIVCkOsRJmBZXIFuDKL3o+ 02IRYptJWbLqsoKLCCPgDbbBQAMdwe8AVHBR5PnTbqtezZPHXuymobWbCqwI7o5v 1FqbzWhkyQ1i7RLa+yIGsUJB4uf/mPefF6HVVHNeUo0=; X-AuditID: 0a0901b2-dfddb70000001406-f6-696a07629f97 Received: from mailgw03.horizon.ai ( [10.69.1.10]) by mailgw03.horizon.ai (Anti-spam for msg) with SMTP id BB.6D.05126.2670A696; Fri, 16 Jan 2026 17:39:46 +0800 (HKT) Received: from wangtao-VirtualBox.hobot.cc (10.9.0.252) by exchange003.hobot.cc (10.69.1.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.27; Fri, 16 Jan 2026 17:39:45 +0800 From: Tao Wang To: , , , , , , , , , , , CC: , , Tao Wang Subject: [PATCH net v3] net: stmmac: fix transmit queue timed out after resume for tso Date: Fri, 16 Jan 2026 17:39:31 +0800 Message-ID: <20260116093931.126457-1-tao03.wang@horizon.auto> X-Mailer: git-send-email 2.52.0 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: exchange001.hobot.cc (10.9.15.110) To exchange003.hobot.cc (10.69.1.10) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeLIzCtJLcpLzFFi42LhcmXk0k1iz8o0OP3I3OLny2mMFssf7GC1 mHO+hcXi6bFH7BaP+k+wWVzY1sdqsbBtCYvF5V1z2CwOTd3LaPHy9TZmi3l/17JaHFsgZvHt 9BtGi0v9E5kc+DwuX7vI7DFvTbXHlpU3mTye9m9l99g56y67x4JNpR6bVnWyeezc8ZnJ4/2+ q2wenzfJBXBFcdmkpOZklqUW6dslcGXcf3yOrWA3f8XV++2MDYxtvF2MnBwSAiYSx46tY+xi 5OIQEljBKLH51n5WCOc5o8TEdRPYQarYBDQk7k69xgKSEBHYwyRx+UUnM0iCWSBVYu/un2C2 sECYxIT5a1hBbBYBVYlHbeuBbA4OXgFbifMbTSC2yUtcn3KAEcTmFRCUODnzCQvEGHmJ5q2z oUZKSBx88QLMFhJQkWg+OZ8doldO4vWG/WwQdozElQcdTBMYBWYhGTULyahZSEYtYGRexSic m5iZk15uYKyXkV+UWZWfp5eYuYkRFFWcjJt2MC5Z8FHvECMTB+MhRgkOZiURXt7faZlCvCmJ lVWpRfnxRaU5qcWHGKU5WJTEebUV4zKFBNITS1KzU1MLUotgskwcnFINTF5Tw3Tubih8WF3o dXZps8aMEkGzSx83v88VrJSPmaCQcn6Pyy+J1nZ1qe2Tm52vRHT6i+241fy57nba7G86iUbh DrdFagR7Pz84YTdxWfTxTX+PH11zdj2DebVlYVo481Hnjz0bYrsKf00Uc/xwMOqo9Yl0k/WM qWm7s9rY3rJ6fwjuMP9gVVHlf8/5q6W1nbRU65ZNO5qijkh1v79q+bslIdMtZuLOt6dz/6tH Nj5fbriEZbfg/Oidpz8+Czrl5vw84v4Kz5qz/f6nFCaniGqfmZj8/sjDPT/eXym0XO7E33Ak prJc55jVg4WCPzfwzzmldLRTl13aVrYh/IbCzqwlEybuV7kUuPB28dLanUosxRmJhlrMRcWJ AN3aH7EZAwAA 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 tru= e, 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, Do not use the last_segment default value and set last_segment to false in stmmac_tso_xmit. Fixes: c2837423cb54 ("net: stmmac: Rework TX Coalesce logic") Signed-off-by: Tao Wang --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index b3730312aeed..1735f1b50a71 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4448,6 +4448,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.52.0