From: netdev-bot+sashiko@kernel.org
To: cbabroski@nvidia.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bryan.whitehead@microchip.com, UNGLinuxDriver@microchip.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com,
linux@armlinux.org.uk, Raju.Lakkaraju@microchip.com,
maxime.chevallier@bootlin.com, yuiko.oshino@microchip.com,
nb@tipi-net.de, woojung.huh@microchip.com
Subject: Re: [PATCH net-next v2 5/7] net: lan743x: handle a failed reopen on resume
Date: Wed, 25 Nov 2026 14:37:05 +0000 [thread overview]
Message-ID: <179561742562.3135.3380061250286040261@kernel.org> (raw)
In-Reply-To: <614c536edbd2cf29e8a53076612404d1091d18c5.1795027003.git.cbabroski@nvidia.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1 (1)
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The RX-filter resync added to lan743x_pm_resume() after
netif_device_attach()…
- [Low] This is a patch-structure concern: one commit bundles three
changes under the subject "handle a failed reopen on resume".
Pre-existing issues:
- [Low] lan743x_rfe_set_multicast() writes and validates only perfect-
filter slots 1..min(mc_count,32).
--
net: lan743x: handle a failed reopen on resume
This patch makes lan743x_pm_resume() check the return value of
lan743x_netdev_open(). On failure it calls dev_close(), and a new ndo_stop
wrapper skips the hardware close while the device is detached. It also
skips the close in lan743x_pcidev_shutdown() when the device is already
detached, drops lan743x_pci_cleanup() from the lan743x_hardware_init()
failure path, and reprograms the RX filter after netif_device_attach().
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index b226078bf3a96..228b6ab539a17 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
[ ... ]
> @@ -4076,7 +4089,6 @@ static int lan743x_pm_resume(struct device *dev)
> if (ret) {
> netif_err(adapter, probe, adapter->netdev,
> "lan743x_hardware_init returned %d\n", ret);
> - lan743x_pci_cleanup(adapter);
> return ret;
> }
[Severity: Low]
This isn't a bug, but the subject only covers part of what this commit
does. It contains three separate changes:
- the reopen failure handling (dev_close() and lan743x_netdev_stop())
- the lan743x_hardware_init() failure path (the present check in
lan743x_pcidev_shutdown(), and dropping the lan743x_pci_cleanup()
call that d6423d2ec39c added)
- the RX filter reprogram in lan743x_pm_resume()
The third change runs on every successful resume, not only after a
failed one. RFE_CTL is written only in lan743x_rfe_set_multicast().
lan743x_rfe_open() writes only RFE_RSS_CFG. So the reprogram also
restores RFE_CTL and the multicast filter on every normal resume.
Would it be easier to review and backport these as separate patches?
[ ... ]
> @@ -4109,10 +4121,23 @@ static int lan743x_pm_resume(struct device *dev)
> * For instance, it is true when system wakesup after pm-suspend
> * However, it is false when system wakes up after suspend GUI menu
> */
> - if (netif_running(netdev))
> - lan743x_netdev_open(netdev);
> + if (netif_running(netdev)) {
> + ret = lan743x_netdev_open(netdev);
> + if (ret) {
> + netdev_err(netdev, "failed to reopen after resume: %d\n",
> + ret);
> + dev_close(netdev);
> + }
> + }
>
> netif_device_attach(netdev);
> +
> + /* ndo_set_rx_mode is skipped while the device is detached */
> + if (netif_running(netdev)) {
> + netif_addr_lock_bh(netdev);
> + lan743x_rfe_set_multicast(adapter);
> + netif_addr_unlock_bh(netdev);
> + }
[Severity: Medium]
Does this resync cover unicast address changes made while the device was
detached?
__dev_set_rx_mode() returns early when the device is not present. That
return comes before the unicast promisc accounting, not only before
ndo_set_rx_mode():
net/core/dev_addr_lists.c:__dev_set_rx_mode() {
...
if (!netif_device_present(dev))
return;
...
promisc_inc = netif_uc_promisc_update(dev);
if (promisc_inc)
__dev_set_promiscuity(dev, promisc_inc, false);
if (ops->ndo_set_rx_mode)
ops->ndo_set_rx_mode(dev);
}
lan743x does not set IFF_UNICAST_FLT, so it depends on the core setting
IFF_PROMISC when dev->uc is non-empty. lan743x_rfe_set_multicast() only
enables unicast acceptance through IFF_PROMISC:
if (netdev->flags & IFF_PROMISC) {
rfctl |= RFE_CTL_AM_ | RFE_CTL_AU_;
Consider this sequence:
- lan743x_hardware_init() fails on resume, so the device stays
detached with IFF_UP set. This patch now handles that case.
- A macvlan, or a VLAN with its own MAC, is brought up on top.
- dev_uc_add() runs on the lower device, but __dev_set_rx_mode()
returns early, so uc_promisc and IFF_PROMISC are never set.
- On the next successful resume, this resync calls
lan743x_rfe_set_multicast() with IFF_PROMISC still clear.
Wouldn't frames for the new unicast address be dropped until a later
rx-mode event runs the core path? __dev_set_rx_mode() and
dev_set_rx_mode() are not exported, so the driver cannot call the core
path directly.
The commit message says:
While the device is detached, the core does not call ndo_set_rx_mode, so
address list changes made in that window, such as IPv6 multicast joins,
which do not take rtnl, never reach the RX filter. Program the filter
again after the device is attached.
The IPv6 multicast case is handled. For unicast list changes, though, the
filter still seems to miss them after this patch.
At this commit lan743x_hardware_init() does not appear able to fail. The
window opens with the later commit "net: lan743x: reset the device on TX
timeout", which makes lan743x_dmac_init() return the SWR poll error. That
commit's reset work copies the same multicast-only resync, so it does not
close this gap.
[Severity: Low]
This is a pre-existing issue, but lan743x_rfe_set_multicast() writes
perfect filter slots 1 through min(mc_count, 32) only. It never clears
RFE_ADDR_FILT_HI_VALID_ in slots past the current list length:
if (i < 33) {
lan743x_csr_write(adapter,
RFE_ADDR_FILT_HI(i), 0);
...
data |= RFE_ADDR_FILT_HI_VALID_;
lan743x_csr_write(adapter,
RFE_ADDR_FILT_HI(i), data);
If the multicast list shrinks from N to M > 0 entries, can slots M+1..N
stay valid while RFE_CTL_DA_PERFECT_ is still set? The hardware would then
keep accepting groups the stack has already left.
Nothing in lan743x_hardware_init(), lan743x_rfe_open() or
lan743x_mac_init() invalidates slots 1..32 either. The new resume resync
relies on this helper, so it has the same behaviour.
> rtnl_unlock();
>
> return 0;
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1795027003.git.cbabroski%40nvidia.com
next prev parent reply other threads:[~2026-11-25 14:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 14:33 [PATCH net-next v2 0/7] net: lan743x: automatically recover from TX hang Chris Babroski
2026-11-24 14:33 ` [PATCH net-next v2 1/7] net: lan743x: check DMA channel stop and reset results Chris Babroski
2026-11-25 14:37 ` netdev-bot+sashiko
2026-11-24 14:33 ` [PATCH net-next v2 2/7] net: lan743x: quiesce TX before freeing the rings Chris Babroski
2026-11-24 14:33 ` [PATCH net-next v2 3/7] net: lan743x: start phylink last and stop it first Chris Babroski
2026-11-25 14:37 ` netdev-bot+sashiko
2026-11-24 14:33 ` [PATCH net-next v2 4/7] net: lan743x: keep the fixed link across reopen Chris Babroski
2026-11-25 0:32 ` Andrew Lunn
2026-11-24 14:33 ` [PATCH net-next v2 5/7] net: lan743x: handle a failed reopen on resume Chris Babroski
2026-11-25 14:37 ` netdev-bot+sashiko [this message]
2026-11-24 14:33 ` [PATCH net-next v2 6/7] net: lan743x: reset the device on TX timeout Chris Babroski
2026-11-25 14:37 ` netdev-bot+sashiko
2026-11-24 14:33 ` [PATCH net-next v2 7/7] net: lan743x: add byte queue limits support Chris Babroski
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=179561742562.3135.3380061250286040261@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=Raju.Lakkaraju@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=bryan.whitehead@microchip.com \
--cc=cbabroski@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maxime.chevallier@bootlin.com \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=woojung.huh@microchip.com \
--cc=yuiko.oshino@microchip.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
all inboxes | Powered by JetHome®