Re: [PATCH net] net: usb: lan78xx: only stop phylink if the network device is running

From: Yuanzhe Liu

Date: Mon Nov 02 2026 - 12:40:04 EST


Oleksij,

Thanks for the testing, and for both tags.

One thing to sort out first: they arrived on the v1 posting, and the patch
changed shape in v2, which I posted separately on 2026-10-31:

https://lore.kernel.org/netdev/20261031165213.2738-1-25031212351@xxxxxxxxxxxxxxxxx/

v2 drops the explicit phylink_stop() and moves unregister_netdev() ahead of
the phylink teardown instead, so that closing the netdev goes through the
normal lan78xx_stop() path. That removes the netif_running() test; and the
three cases you reproduced -- never opened, after ifdown, and ifup/ifdown
during removal -- are all cases where the interface is not running at that
point, so v2 does not call phylink_stop() there either, same as v1.

The path that does differ is a removal with the interface up: v1 stopped
phylink directly from lan78xx_disconnect(), v2 gets it from lan78xx_stop()
via unregister_netdev(). Your "interface open, sending, link up, link down,
link flapping" runs cover that path in its v1 form only. If you want to
re-run them against v2 before the tags stand on it, that would be welcome;
otherwise I will take your Tested-by and Reviewed-by as applying to v2 as
posted -- tell me which you prefer.

It is also the approach 312c816c6bc3 took for the NAPI teardown, so the
shape is not new to this driver.

Thanks for checking the pre-phylink kernels too -- that is the direct
confirmation of the Fixes: tag Andrew asked about, so I think that question
is settled.

Thanks,
YuanZhe