๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5411

Re: [PATCH net v5 2/5] net: ethernet: mtk_wed: fix reset condition for rx wdma

#5411
From: netdev-bot+sashiko
Date: Tue, 20 Oct 2026 10:10
63 lines
10038 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 for "net: ethernet: mtk_wed: fix reset
  condition for rx wdma" only says the condition in mtk_wdma_rx_reset()โ€ฆ

--

net: ethernet: mtk_wed: fix reset condition for rx wdma

This commit inverts the check in the rx_wdma loop of mtk_wdma_rx_reset().
Allocated WDMA RX rings now have their CPU index cleared. Unallocated
rings are skipped.

> In mtk_wdma_rx_reset, only the wdma rings that weren't allocated are
> reset which is wrong.
>
> Fix this by inverting the reset condition so allocated rings will be
> reset.

[Severity: Low]
This isn't a bug, and the code change looks right. Could the commit
message say what goes wrong for users, and which paths are affected?

mtk_wed_start() sets up every rx_wdma ring that doesn't have a
descriptor yet:

drivers/net/ethernet/mediatek/mtk_wed.c:mtk_wed_start() {
    ...
	for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++)
		if (!dev->rx_wdma[i].desc)
			mtk_wed_wdma_rx_ring_setup(dev, i, 16, false);
    ...
}

So once the device has started, all rx_wdma rings normally have a
descriptor. The exception is when buffer or ring allocation fails.

With the old condition, the loop in mtk_wdma_rx_reset() would then skip
every ring. MTK_WDMA_RING_RX(i) + MTK_WED_RING_OFS_CPU_IDX would never be
cleared for any live ring.

mtk_wdma_rx_reset() has two callers:

mtk_wed_reset_dma()
    /* 2. reset WDMA rx DMA */
    busy = !!mtk_wdma_rx_reset(dev);

__mtk_wed_detach()
    mtk_wdma_rx_reset(dev);

Could the message add a sentence on the symptom? For example: stale WDMA
RX CPU indices after a WED/SER reset, or after detach and re-attach.

That would help reviewers and stable maintainers judge how urgent this
Fixes: patch is.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261016-wedfix-v5-0-8b02e78fd34f%40gmail.com
Technical Details
Message-ID: <179249104136.3135.17477394405108454102@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349188-linux-kernel-netdev=dewy.ru
References: <20261016-wedfix-v5-2-8b02e78fd34f@gmail.com>

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-349188-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v5 2/5] net: ethernet: mtk_wed: fix reset condition
 for rx wdma
Date: Tue, 20 Oct 2026 10:10:41 +0000
Organization: Usenet Network
Message-ID: <179249104136.3135.17477394405108454102@kernel.org>
References: <20261016-wedfix-v5-2-8b02e78fd34f@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3828930"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ThrkYRhIYvGjeEq+uyKfv073SUA= sha256:tK25NEZp3c6aKEFvISvyOiJvvH64rEqEjk303B9paHQ=
	sha1:iRn73qy4RtdzkGh7IhqBgLgLnkM= sha256:FgxVNpT0MCfZezCHa3wk8pJN1/ih6D0zVNBHaw31JUE=
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 14B3F110C87; Tue, 20 Oct 2026 13:16:50 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.728
X-Spam-Status: No, score=-3.728 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, 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 FZfYanwGeXos;
	Tue, 20 Oct 2026 13:16:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349188-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 62795110C50; Tue, 20 Oct 2026 13:16:38 +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 55F033EAAB; Tue, 20 Oct 2026 10:11:15 +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=1792491049;
	b=YkIQfpOvJOm5E2H2ebEdcd0lFzfchRe5/VbuLFPzftVn1nnQSFsHN5SR8BQsJyPqHdmW
	 TPqCTgOBxN466kpHN9zkbHZNghKnmWaUGbQ5zy6qgXEh/UOVwVCHZ72fVEAk/NK5LDkDk
	 LZViV9xj4w1VGUh1vWWBkBbvtT3yeC9+eZue18a6cCQ9FY5rFrRHKnTyl3kTKuSeDl+AV
	 +/YbSe2rdY2BJy7Z6+OqAV70lL3Aq+4M+67z57GJjOuD5rFzm8vdLatGCn3ZK4JMUJBXu
	 dnAQVG8iWJtW1IQwzPiEua4qVlC008K7JnlftcmcsXoM8MwsQsiJPbVZLSqNMom6y1g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792491049;
	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=Bh9xFMrMUcNCltBKfyRaDPZe6ka6eyNBp32oRnvdPjk=;
	b=DJWBM1g/lp3DZOH7ZP5PlByDQd/u1UVoMl2OtJ1vsiL4qc1VOopbeUYVc1ow0DaS14MH
	 /yj6QtHH8qD6IngNY+Yj9apcXKlYFwRac4vuw6g3Ft2aoo7cvEakp6EK5wC67PsjGb9qZ
	 haBhhB9XIwtTyKZLkWfJs3ONTZe33ptrcPQ0M/It8pDMLzttouAcsiJHRH4QxOeiHmAX+
	 9IWHA3Gdqr5FWAWdwJaaeReqvl+dnD3aPTeOrsKjuwF5OYjVv09vORqQoilMbdtjXqHJH
	 +FMU8ukC/gkZeanRj7tEuocRdd5gIOrWZxBrfZF4UCL99sRu9x3loZa6l6d67Ne+T+A==
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=Drp4JXrl;
	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 12E8E60A262E;
	Tue, 20 Oct 2026 10:10:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Drp4JXrl
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=1792491043;
	b=EtlQqP++jYqIoI/QJLMh4fbBvHoNDKPFPvPaA4pvd4rKRKqRsWOLch9vgg7yTh0TkzvH
	 SmiYveHigTcdyQML9NUu1UGbLXfHVHGu4IqXMnuGTGcxs5nCndeaVQteu2LYmmlWsOlHB
	 /Nwlqvhlbrt0fLRoysWiKY9hu4pCIGIHkJLSKATq0tnezK3LGsra/Lhs5K7wuU2gCbD1r
	 ay0SqHf7cQWTMllUxs6Y4dTUO/3DgRD8s02RacHEqXkVEXvQA5TqfsMr9kVyIOF6NT7Io
	 j+K8WuPTQA7VbbNQJtQO/yylGA+fD+0G4VyJmHQC//Q6ai7sfsM2+AZC6a8nmcL2e2g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792491043;
	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=Bh9xFMrMUcNCltBKfyRaDPZe6ka6eyNBp32oRnvdPjk=;
	b=0jkQYf8RygXMz7d8b1o+utLOtm2e9+e4rSGjP9/mN6kvewLWC+yjMr+6wDqPPVrLCwh+
	 IeM452dNz+Nx/7rs9MUhBnw8/rhiwCeLdvokPoC2PZiBtaS5Yfh5hdfOwraeufckF9/44
	 QvWi2SGrrIi24uEWjzbZt5otoZeCLv4ThGkG0fxx/saBFhZm6ej0BDBELuihLR6/BU4oP
	 sRTkGVO3xCewOu3E0SP9zS/bH6nHBARDRzHZ7Z+kfUFzeKE5gYVncsFylO++M3zi39f17
	 ajeA6PidpK1+vNAa5AxcbBohMvIyEQIOYtAmn7G4WnYTE9v0j3/4eH8Bgo6rrFLILrw==
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=Drp4JXrl;
	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 EDF08606A319;
	Tue, 20 Oct 2026 10:10:42 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1DFE1F000C6;
	Tue, 20 Oct 2026 10:10:41 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792491042;
	bh=Bh9xFMrMUcNCltBKfyRaDPZe6ka6eyNBp32oRnvdPjk=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Drp4JXrlplx+lS7qurSjPflAV3uulAv2Ndb12n1kdwtv/dR/0GXGs+foaoVDzbcSf
	 11YA3u9W5DHbjuLCLQJq4KcpW3KVgYwii7+v09FLtCCQK1bjqNosjOrkZHFtAUoL5n
	 DLrHgoGSDtf9k94/Ppf3GJN82r8Lv3k4qIajSWGG8ov6/lFooCakjjKrnjNapaY8bq
	 qKaY6wur20axcXFArlSgKY9wNb5TpapfUBeKSyYk1rYqyH69SCTENpprumfzY6QFOx
	 LHNbhY3SOzCKUdMQZD4rZ5Mp16xZePSccuZwozEy8QPCLWQohINyJEJTBDFIVLwUZQ
	 ageQ/3u8cCIlw==
X-Cc: 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,
 sujuan.chen@mediatek.com, rex.lu@mediatek.com, netdev@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-mediatek@lists.infradead.org
X-In-Reply-To: <20261016-wedfix-v5-2-8b02e78fd34f@gmail.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