Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: wei.fang@oss.nxp.com
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
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	[thread overview]
Message-ID: <179541033517.3135.5228725617878780083@kernel.org> (raw)
In-Reply-To: <20261119030534.1892935-5-wei.fang@oss.nxp.com>

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

  reply	other threads:[~2026-11-23  5:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  3:05 [PATCH v8 net-next 0/9] net: dsa: netc: add PTP support for NETC switch wei.fang
2026-11-19  3:05 ` [PATCH v8 net-next 1/9] ptp: netc: use ioread64_lo_hi/iowrite64_lo_hi for 64-bit register access wei.fang
2026-11-19  3:05 ` [PATCH v8 net-next 2/9] ptp: netc: remove unnecessary pcie_flr() call in probe wei.fang
2026-11-19  3:05 ` [PATCH v8 net-next 3/9] ptp: netc: export netc_timer_get_current_time() for cross-driver use wei.fang
2026-11-19  3:05 ` [PATCH v8 net-next 4/9] net: dsa: netc: tie setup resources and reset to DSA setup/teardown wei.fang
2026-11-23  5:05   ` netdev-bot+sashiko [this message]
2026-11-23  6:00     ` Wei Fang
2026-11-19  3:05 ` [PATCH v8 net-next 5/9] net: dsa: netc: use entry ID instead of pointer to track host flood rule wei.fang
2026-11-19  3:05 ` [PATCH v8 net-next 6/9] net: dsa: netc: check return value of ntmp_ipft_delete_entry() wei.fang
2026-11-23  5:05   ` netdev-bot+sashiko
2026-11-19  3:05 ` [PATCH v8 net-next 7/9] net: dsa: netc: enable ingress port filtering lookup by default wei.fang
2026-11-19  3:05 ` [PATCH v8 net-next 8/9] net: dsa: netc: add PTP two-step timestamping support wei.fang
2026-11-23  5:05   ` netdev-bot+sashiko
2026-11-19  3:05 ` [PATCH v8 net-next 9/9] net: dsa: netc: add PTP one-step " wei.fang
2026-11-23  5:05   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179541033517.3135.5228725617878780083@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=wei.fang@nxp.com \
    --cc=wei.fang@oss.nxp.com \
    --cc=xiaoning.wang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox