Netdev List
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Stefano Munari <stefanomunari.sm@gmail.com>
Cc: Thangaraj Samynathan <Thangaraj.S@microchip.com>,
	UNGLinuxDriver@microchip.com, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: usb: lan78xx: resume phylink on non-reset USB resume
Date: Tue, 3 Nov 2026 08:37:37 +0100	[thread overview]
Message-ID: <aumPQeI3lInBvbNT@pengutronix.de> (raw)
In-Reply-To: <20261102235133.23011-1-stefanomunari.sm@gmail.com>

Hi Stefano,

On Tue, Nov 03, 2026 at 12:51:33AM +0100, Stefano Munari wrote:
> lan78xx_suspend() calls phylink_suspend(dev->phylink, false) on an open
> interface, which always stops phylink and halts the PHY. The matching
> phylink_resume() is only called from lan78xx_reset_resume().
> When the USB device stays powered across system sleep (e.g. s2idle) and
> the USB core calls .resume instead, the link stays down until the interface
> is brought down and up by hand. The ifdown triggers:
> 
>   WARNING: drivers/net/phy/phy.c:1670 at phy_stop+0x44/0xc8
>   called from state HALTED
> 
> Move phylink_resume() to the end of lan78xx_resume(), which both resume
> paths go through, and call it only if the resume succeeded and the
> interface was open, mirroring lan78xx_suspend(). As a side effect,
> lan78xx_reset_resume() no longer starts phylink on a closed interface.
> 
> Tested on a Raspberry Pi 3B+ (LAN7515) with s2idle: the link now comes
> back up on its own after resume and ifdown no longer warns.
> 
> Fixes: e110bc825897 ("net: usb: lan78xx: Convert to PHYLINK for improved PHY and MAC management")
> Signed-off-by: Stefano Munari <stefanomunari.sm@gmail.com>

Partially tested on net-next (4dd16e31135e) with a LAN7850 on an
i.MX8MP. The USB host is reinitialized across s2idle here, so only
.reset_resume is used. With the interface closed, s2idle resume no
longer shows "multicast write failed -EACCES" and the WARNING at
phy.c:1352 in _phy_state_machine() (4/4 without, 0/4 with this patch).
An open interface still comes back after resume. The plain .resume
path, which is the main case of this patch, is not tested.

Tested-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 |

      reply	other threads:[~2026-11-03  7:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 23:51 [PATCH net] net: usb: lan78xx: resume phylink on non-reset USB resume Stefano Munari
2026-11-03  7:37 ` 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=aumPQeI3lInBvbNT@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=Thangaraj.S@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=stefanomunari.sm@gmail.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