๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20724

Re: [PATCH v8 net-next 4/9] net: dsa: netc: tie setup resources and reset to DSA setup/teardown

#20724
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 05:05
75 lines
10647 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 patch changes how netc_switch_pci_init() handles a failed
  probe-time FLR, and the commit message does not say so.

--

net: dsa: netc: tie setup resources and reset to DSA setup/teardown

This commit adds netc_switch_reset() so that every netc_setup() after the
first one does a PCIe FLR and starts from a clean hardware state. It also
converts the setup-path devm_ allocations to explicit alloc and free.
These are released in netc_teardown() and on the error paths.

> diff --git a/drivers/net/dsa/netc/netc_main.c b/drivers/net/dsa/netc/netc_main.c
> index 1225ff8153d44..f724f95add36b 100644
> --- a/drivers/net/dsa/netc/netc_main.c
> +++ b/drivers/net/dsa/netc/netc_main.c

[ ... ]

> @@ -1042,7 +1161,10 @@ static int netc_switch_pci_init(struct pci_dev *pdev)
>  	void __iomem *base;
>  	int err;
>  
> -	pcie_flr(pdev);
> +	err = pcie_flr(pdev);
> +	if (err)
> +		return dev_err_probe(dev, err, "FLR failed\n");
> +

[Severity: Low]
This hunk changes probe behaviour, and the commit message doesn't say so.
Before, the return value of pcie_flr() was ignored and probe always went
on. Now any FLR failure in netc_switch_pci_init() makes probe fail.

The commit message only says:

  The probe path already performs a FLR in netc_switch_pci_init(), so the
  first setup will skip the reset because the priv->configured flag is
  not set.

and later:

  The NETC switch does not support multi-switch yet, so there is no
  functional problem today. This only reworks the driver so that
  multi-switch can be added later without hitting these issues.

Both passages read as if the probe path is unchanged.

pcie_flr() can fail in three ways:

  - -ENOTTY when pci_dev_config_accessible() fails
  - an error from pci_dev_reset_iommu_prepare()
  - an error from pci_dev_wait() after PCIE_RESET_READY_POLL_MS times out

In any of these cases, a NETC switch that bound before this patch would
now fail to probe.

Failing probe is probably the right behaviour, since the driver relies on
a clean post-FLR state. Could the commit message mention this change, or
could it go into its own patch? The hunk is still the same at the end of
the series.

>  	err = pcim_enable_device(pdev);
>  	if (err)
>  		return dev_err_probe(dev, err, "Failed to enable device\n");

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119030534.1892935-1-wei.fang%40oss.nxp.com
Technical Details
Message-ID: <179541033517.3135.5228725617878780083@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369040-linux-kernel-netdev=dewy.ru
References: <20261119030534.1892935-5-wei.fang@oss.nxp.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369040-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v8 net-next 4/9] net: dsa: netc: tie setup resources and
 reset to DSA setup/teardown
Date: Mon, 23 Nov 2026 05:05:35 +0000
Organization: Usenet Network
Message-ID: <179541033517.3135.5228725617878780083@kernel.org>
References: <20261119030534.1892935-5-wei.fang@oss.nxp.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3794932"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:yDf1I4QyjOgvapQ7E23yd9oEwZ0= sha256:kG5vLBQCacydxO/vqenSgLSE0+Ar2kNIv8QjVREg7jQ=
	sha1:XkpYY2NAb3CLeXsawCyjq5DgwlQ= sha256:GAXdi4u/IF5FPEVmKwQqmbYGA9KtPl1TCG6whnXk3fU=
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 9E4E9125D8E; Mon, 23 Nov 2026 08:06:12 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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 o8TKwqa-vuqk;
	Mon, 23 Nov 2026 08:06:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369040-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 EA168125D89; Mon, 23 Nov 2026 08:06:00 +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 D59BC2DBAE; Mon, 23 Nov 2026 05:05:48 +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=1795410343;
	b=CnjE67H/zt8LsVcj47bqBj9POddfxR9cUF2Zj2nA34iskCvuF7kgUefKXFcmfZPqB2UQ
	 ZSArZ4XUY/7IfR9Cs1opNgmOqu6hmgbdozPZIXrhabI617oUy9dcvJ9PxpknPoZ+y9FtV
	 PxEMO9glgflnidPgU3XzZZ6kcAKs00yrdBWPyBGHh7Xo9mQxASSZtuM8O6frfQrl8WU7n
	 O1pkOiZlXg44J3Y04+ca12ZkxFExcJV9KF4jtdEQ4SlUkF9lltIlkaopwbgWYUjB/7Q7n
	 cuFBvHgTqPvlB2Sk0gXxLT+5OFQ15tfmDANWqu/dY9C6VPeS8R6Bl3NJjs/edI9HViQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795410343;
	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=kc1WDNzqnWa7MzsqOAzEg3sXZ0FXTjUIsij2hS/psy8=;
	b=yKT7Oipv80+fakIgAY8m8m0Nq7z0oGTKFatzcDY6oye6RbLUKUnqpItSbZkkrr/O8wUr
	 J7cVvCSM+RjCZPyNyCbm619GFCx/SwlhElomJqAxgJ5oN150SLgouw7R1ZDYovdVklmYQ
	 U61qnA5ZXgSP7aL5OBXRyyeP22LvEwk3ZmIJXKitju8ZNCymZW7Yulpi4riIBkV2UKzfs
	 VNntg0VlSQ7opbdHGIVzieDTKn6JbjBrgIFFJmo44GBD5zi+aiMJYd/mLOIyeJwjssFac
	 WHCanND4ot2OGz8uAz+qVZ9kEYPW7VgyL+paw+C5KdaRnK1+7EEZOZ5AENWyCsKRt/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=MaJmLHh7;
	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 272FB606A6A0;
	Mon, 23 Nov 2026 05:05: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=MaJmLHh7
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=1795410337;
	b=HClMul9j79aHQP85OkDKHKfC5H3hujKl99KjTelCZ7ccR68LY8tYjmsfr2Z37cY/bglM
	 on9Rj8Kru3sQEok4m8AVcu7WRmKjp3Z1vRcNWKrgd/o2WiJ6pPOZRehH+O1ANqNQu3Xl/
	 MKtJt8GmUNW9T1MPVCythvUGb4d+QcUNNEi3SavrayM2ybiAbEL0ixgscH1Tt6h+lHEY8
	 2cRJY7rScxfqBF4nS4zWwoB4u9CIcNivwk/V5EXvXeKL9xjAbrWBQDUIrdA1R4nslcUTz
	 aaOrvOh8qtQefreobUHFyDSucrw1R4HDaGhiOwCh+mvBt2+rFD+glUEvdf0yd3YdNMg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795410337;
	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=kc1WDNzqnWa7MzsqOAzEg3sXZ0FXTjUIsij2hS/psy8=;
	b=UMqixHALkSixwbHCcovprjnS8XF1rswOK/0knw4FsZ2TTpS0W2p144g+9iSzB2UHMu7c
	 D9rjruD9UzmsCXVH0DBsc5M97Jfj2I/g5i9ImYziSI2dmh3GOF2hqfo2wRaXYASp90f5A
	 ZgCHZtgpJGRx6mdRvFlehe6QEfyhZ9t3zo0zqDS2cN4VwZU4IzxxgJehMFM9A+tNIqde/
	 frniisL64O9yN1wpYMFMNhwTdxfqGIwQk4NJMMmxPQioJsHUSClBlobWvR/QOucp8aBZB
	 oqEk7/Yctl0kaJnxNs4PRhbr5aP5pCDg3S+ALWZoZ5BfELTqLLlxL1kIoDddd5VyJBg==
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=MaJmLHh7;
	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 47244606A31A;
	Mon, 23 Nov 2026 05:05:37 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99B6C1F000CA;
	Mon, 23 Nov 2026 05:05:35 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795410336;
	bh=kc1WDNzqnWa7MzsqOAzEg3sXZ0FXTjUIsij2hS/psy8=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=MaJmLHh73l7lNwukwY22xJ7TRPlLyjsKgI6pQH3BWlzUQYCqKS6z5xd9rP6LXTe4s
	 NDRy/Kdzc1QCkY8khTw91OdWz9E38XGfiyjbKlxz8VJ5GJ67k+MKXBnHvkIvbKOKaF
	 i2lEzuClX9n2A2rFbOC9dLOcP1RpTiq8BWLsqKx+XxtKkv1X5Sd0Oad+NJ+u/P21sq
	 49uho1bKuptVA/znJFwH0qo+mIZ2gDReW9eyAr9MNFyAomkqcRBhLZVmhNXE/GQ+qM
	 PP2dqtmReItxuqsTqV3WiwPpCl/jS0oqf12gHVKteZHYIFda+sKvbxAr/zQOX3Lx67
	 Bz2PZVJKjrvJw==
X-Cc: xiaoning.wang@nxp.com, andrew@lunn.ch, olteanv@gmail.com,
 andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
 richardcochran@gmail.com, linusw@kernel.org, linux@armlinux.org.uk,
 wei.fang@nxp.com, imx@lists.linux.dev, netdev@vger.kernel.org,
 linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 linux-arm-kernel@lists.infradead.org
X-In-Reply-To: <20261119030534.1892935-5-wei.fang@oss.nxp.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