Article View: linux.kernel.netdev
Article #15450Re: [PATCH net-next v4 1/3] net: ethernet: mtk_eth_soc: reset RX DMA
From: netdev-bot+sashiko
Date: Thu, 12 Nov 2026 23:47
Date: Thu, 12 Nov 2026 23:47
75 lines
10743 bytes
10743 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message does not accurately describe the change.
--
net: ethernet: mtk_eth_soc: reset RX DMA
This patch moves the DMA_MAPPING_ERROR initialisation of dma_addr in
mtk_poll_rx() to the top of the RX loop, so it is reset on every
iteration. On MTK_36BIT_DMA SoCs, a descriptor that is released through
release_desc without a new mapping then keeps its own high address bits
in rxd2.
> net: ethernet: mtk_eth_soc: reset RX DMA
>
> [ ... ]
>
> With MTK_36BIT_DMA and DRAM above 4 GiB the hardware then DMAs the next
> frame to an address that is neither buffer, and the driver passes the
> stale contents of the untouched buffer up the stack.
[Severity: Low]
This isn't a bug, but could the subject line be more specific?
The patch only resets the local dma_addr variable at the top of each
iteration of the loop in mtk_poll_rx(). No RX DMA engine is reset.
In this driver, "reset" usually refers to the hardware/SER reset code
(MTK_RESETTING, mtk_hw_reset(), reset.monitor_work). Someone reading the
shortlog, or a stable backporter, could take this for a change to the
reset path.
Should the body also say that this completes commit 6e0490fc36cd ("net:
ethernet: mtk_eth_soc: fix SER panic with 4GB+ RAM")?
That commit added this check at release_desc in mtk_poll_rx():
if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA)) {
if (unlikely(dma_addr == DMA_MAPPING_ERROR))
addr64 = FIELD_GET(RX_DMA_ADDR64_MASK,
rxd->rxd2);
else
addr64 = RX_DMA_PREP_ADDR64(dma_addr);
}
The check only works if dma_addr is DMA_MAPPING_ERROR on every release
path. Since commit e10a35abb3da ("net: ethernet: mtk_eth_soc: fix
uninitialized variable"), dma_addr is set only once, before the loop. So
the MTK_RESETTING path that 6e0490fc36cd was fixing can still pick up the
high bits of a buffer mapped for an earlier descriptor in the same poll.
mtk_rx_clean() then unmaps an address built from mismatched high and low
bits:
if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA))
addr64 = RX_DMA_GET_ADDR64(rxd->rxd2);
dma_unmap_single(eth->dma_dev, ((u64)rxd->rxd1 | addr64),
ring->buf_size, DMA_FROM_DEVICE);
This is the SER panic described in 6e0490fc36cd. The body covers the
misdirected DMA and the stale data passed up the stack, but not this
unmap during SER.
Would it make sense to mention it and reference 6e0490fc36cd in the
commit message?
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/patch-fc08a7ef40667bf3017366e452e6d3c0%40loljews.com
Technical Details
Message-ID:
<179452725530.2199510.183276812923001293@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362271-linux-kernel-netdev=dewy.ruReferences:
<patch-6b45cf654903652eb4ed98e2e7514f5c@loljews.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362271-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v4 1/3] net: ethernet: mtk_eth_soc: reset RX DMA Date: Thu, 12 Nov 2026 23:47:35 +0000 Organization: Usenet Network Message-ID: <179452725530.2199510.183276812923001293@kernel.org> References: <patch-6b45cf654903652eb4ed98e2e7514f5c@loljews.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1211767"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:biJ28iG2z3aQ77UOG15zher2Cu8= sha256:y2KXRRLl5XjFajSSJAKJYvhoGsjJz1YcaMiJ+ofDYSc= sha1:eFs/ry55KcwMbf4BqpwGy2qn4NE= sha256:jYBQIZlmcyv80GbAyPe8rFOUybwIawirzAict5OXYZk= 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 9395D1143E7; Fri, 13 Nov 2026 03:06:48 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.5 X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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=kernel.org 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 Mig40zwL87Yk; Fri, 13 Nov 2026 03:06:45 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-362271-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id DC3D61143E4; Fri, 13 Nov 2026 03:06:36 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id F3D5960D62F; Thu, 12 Nov 2026 23:48:05 +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=1794527263; b=Tk8nIpC1AJQukZMxEpwH/doVc5OWZV77OjcCaBaT4e5GjaUl3i9dHhwmI1a+SYMdfK/m rF1R4Xonk6kX+aXH05BIUM6cwtUGNJkNVh3l4JyFcB8100Elx9kYNjMXRKmV84ejL5Gje 6JYVHzs0oj43lPAU1PquDN4x1XQVh/wxelonjAc2EAhYTp563lONWtn1irnQuuBZasdyI bNaeiMbkC29Cuv7Fh019B9MxUY5xE88f61mYhW+n3CnX9gfclwSiljjHBrHeRbyh+hKvP DxDwawTDPkix3VmJp9PCHZm//hs8p3a1Y9L3R8KNH9d7O75EAoPblLae48fUGPCjnSg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794527263; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=ihiq+0qddYW2J+cwl+nH5pr1pmcIs2DvPvGp5YujItE=; b=lmxAsBiFQ7+uuWGrvGrw24iPNMNP1eb74pV3bjRugr5+6YIYwKSFPdfytKdRrw5FxZUY 40RSJq4YSqkfZiwpl+w3RWelPtLp7j+4pF2iGuNFbJt+JVSRu9mR3YDK/o5+319fEqdks OSnIOan4hNggjzhwbAc04gOoCl7MOlVEo4jlbiD2fcxK1GJAVr/FUZkYWftYvIF0tgz5+ HEfO6GldBAtJdS97btNkK5a1dGsU90/ExJi38WasG+NNL6kVjDw39m1XOcMA7B2RbdVm1 EiDZauyZHlUlpPDq4PYdYWkkKKkNFGUhnRXuGbz2Gi3d5UKJbJ1xAsAzskkOM22UB2w== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=iDhs6wU2; 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 24648606A32D; Thu, 12 Nov 2026 23:47:43 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=iDhs6wU2 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794527257; b=0d2PlCE31ba6gBIUmH9ZhUmFVfWP7QU1+XIo2nnv/Pozsl0TXF3T2vRK8RPHX3ImoL3p IpFXUNSzQVDmyB+PRydEL4uBfEabaFFlEA73cknXxo5rK78AW8pKomCZK25BLPAjkeYZC Jev8LCkQhr/C3vsMIfXbbVH+L0jHwt5WFuYe9XjQ9iwsNX/R9xETWMhHw6fOTbwc33099 baDAvVYZnbrLNKkVxCkFvKcuf9gI9CklhRUyYPJDEunS9RsomY9gnX/pOhOdjp5zVBGmx MQLJlThCqAjLboN/02eWl3eqsjwJaELYLfJRjJHKfl+2NulATnQhmlVLN1RdetWcBCw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794527257; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=ihiq+0qddYW2J+cwl+nH5pr1pmcIs2DvPvGp5YujItE=; b=HJUsxWScm5sEOUYP4JVVh5udNcr81oOGHbBplV/B2Z8BPsJ0wFNNezzhNFqcItr3QJ0d SBqRBM367ncSmu9kklr6CQ57xlirKJwfhX7nJHNGVckEPVEFtjCIXdXTGZDizcupn1D0B WtKxwBfPofZmM004a0sHU+wyu/vqH0B9PBeAXgtXkeRO09pjZw0Nequ1fOUkRB8wAwwh2 2rbngnNwciVh/o9jHGoInsHor4mRcu1aI4V2gjokuXuD1ODtcxrkHKJS0F28AtJXmm/LQ JLQIuq3c6irV77cix2k0+hXPrxH1Qi1MJv2enDDgphp0Z6bD5rObKNyfnbb/FDkAofw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=iDhs6wU2; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 403B4606A321; Thu, 12 Nov 2026 23:47:36 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB4301F000C5; Thu, 12 Nov 2026 23:47:35 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794527256; bh=ihiq+0qddYW2J+cwl+nH5pr1pmcIs2DvPvGp5YujItE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=iDhs6wU2RWdAuAsKAj9BTZP4O9whlnUCeeRWRZ86YVknzdYZybxJjR8v9UpF2c/D/ 4Y+cHpL2KHoA/cwnU5Z0OX/qhwqii0nLOtz+yYkn//3O8HBX8l2Su7yKg5ch/x4eEP QCy7CYuXiGvYPX9SnsjhhRrP1IFO74+6y+NdspjPvEEmH6XGJbi8mrbDou0l9QCp4y HPz1uIXfcPyBA0IYKVvqjXXKUz28WrZLrTXOiqQQYUiH1KfvrWkFHkiQexJf9YScXr /T2lCT264WXKfhaPqu59TvvxAxXNE+pPj8wx07PH5eq+J23QR60zNM04cZFLQzdVi3 DHpxH85131v/Q== X-Cc: netdev@vger.kernel.org, nbd@nbd.name, lorenzo@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, linux@armlinux.org.uk, mason-cw.chang@mediatek.com, frank-w@public-files.de, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-In-Reply-To: <patch-6b45cf654903652eb4ed98e2e7514f5c@loljews.com> X-sashiko-severity: Low 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