Re: [PATCH v8 net-next 4/9] net: dsa: netc: tie setup resources and reset to DSA setup/teardown
From: netdev-bot+sashiko
Date: Mon Nov 23 2026 - 00:05:43 EST
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