From: Oleksij Rempel <o.rempel@pengutronix.de>
To: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Cc: Thangaraj Samynathan <Thangaraj.S@microchip.com>,
UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrew Lunn <andrew+netdev@lunn.ch>,
Russell King <linux@armlinux.org.uk>,
stable@vger.kernel.org, Bin Yu <byu@xidian.edu.cn>,
Cheng Wen <wencheng@xidian.edu.cn>
Subject: Re: [PATCH net v2] net: usb: lan78xx: let unregister_netdev() stop phylink
Date: Tue, 3 Nov 2026 06:31:02 +0100 [thread overview]
Message-ID: <aulxlj404e_atUAS@pengutronix.de> (raw)
In-Reply-To: <20261031165213.2738-1-25031212351@stu.xidian.edu.cn>
On Sun, Nov 01, 2026 at 12:52:13AM +0800, YuanZhe Liu wrote:
> lan78xx_disconnect() stops phylink before unregistering the net device.
> phylink_start() is only called from lan78xx_open(), so when the device is
> unplugged before the interface has been brought up, the attached PHY is
> still in PHY_READY and phy_stop() reports:
>
> called from state READY
> WARNING: drivers/net/phy/phy.c:1670 at phy_stop+0xad/0x380
>
> The same warning is emitted after an ifup/ifdown cycle, where the PHY is
> already in PHY_HALTED.
>
> unregister_netdev() already closes a running device, which calls
> lan78xx_stop() and phylink_stop() with dev->dev_mutex held and after the
> URBs have been terminated. Unregister first and disconnect the PHY
> afterwards, so the interface is stopped exactly once and only while it is
> running, and the net device can no longer be opened while its phylink
> instance has no PHY attached.
>
> Fixes: e110bc825897 ("net: usb: lan78xx: Convert to PHYLINK for improved PHY and MAC management")
> Cc: stable@vger.kernel.org
> Co-developed-by: Bin Yu <byu@xidian.edu.cn>
> Signed-off-by: Bin Yu <byu@xidian.edu.cn>
> Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Thank you!
Best Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2026-11-03 5:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-31 16:52 YuanZhe Liu
2026-10-31 20:33 ` Andrew Lunn
2026-11-01 5:26 ` YuanZhe Liu
2026-11-01 19:22 ` Andrew Lunn
2026-11-01 16:52 ` netdev-bot+sashiko
2026-11-03 5:31 ` Oleksij Rempel [this message]
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=aulxlj404e_atUAS@pengutronix.de \
--to=o.rempel@pengutronix.de \
--cc=25031212351@stu.xidian.edu.cn \
--cc=Thangaraj.S@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=byu@xidian.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=wencheng@xidian.edu.cn \
/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®