From nobody Wed Oct 1 22:26:31 2025 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5CC32BEFF8; Sun, 28 Sep 2025 08:59:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759049979; cv=none; b=vBIK5tdYR3dqbWB5KKpGQuPeDstoK25gvVcbvQWkzh4GnHthYADzSUL4Q2IOs+0Bex70iP3lMZ17A+BeB406IXes7QyODufBGVxc0L7aXcZZVHihyi89klt3RiV4KF8OP68X1scG/brygjAQvg24jTvbFuyA/GUAVi9v3vX0z+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759049979; c=relaxed/simple; bh=4vniLi8C9goigp8i7K2za5WqcBRykgM+uRE16WVj3ZY=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=CPL6ijtFrLIh9i2F9CLdmHg195Dr4LC5h2RvvifoQkbqzj5GvhQSYTvFs/UPyo5p/3qXxD1nIGpwJ8KCmgoU1E8q7iMYxmLQ/yEqDTdt4Z9JUs9JMPvq2k+7FhduVSmkTgGky4PqV9xgSSFJ5P0hdbsuoqa0nLSa+BjYUuKF7NA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=DqgYUnER; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="DqgYUnER" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=g1oVnAqIRynEdvtoz62JGVAuoit/j3pFYMM2fpFBQec=; b=DqgYUnERY07W98n11vJicdqk2c go4P3eNuR4PhwpX9UriGbqN914adWhCxKX1xklzqxcuTc4WmC5k02LkVbwLSVp54/6p8645fclIJn vueeOYLqex3ojNdfYWAuFARcfeBNOWUVCfQLP6Q2RSygJEgzcmt3+9I5f+SfaroLxbOhYpFRqa4i7 wpGNXMxzMSWFf3888PzzEy89aR38G61KzonQZNpJ/aIXPbJO+M47tOWIvUPRUyLG1o8CPZhZKvjga Sg74MoNL7UDBbccqR6Xv+4k7MPU3ZshqYrn3D7T8YbGTE7ovXzAYVZ1IntRvaAC2zvvbmiGXor5cC kTqK31iA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:40264 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1v2nFd-000000005Bv-3hCj; Sun, 28 Sep 2025 09:59:26 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1v2nFX-00000007jXn-2pUD; Sun, 28 Sep 2025 09:59:19 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit , Florian Fainelli , Gatien Chevallier Cc: Alexandre Torgue , Andrew Lunn , Andrew Lunn , Christophe Roullier , Conor Dooley , "David S. Miller" , devicetree@vger.kernel.org, Eric Dumazet , Heiner Kallweit , Jakub Kicinski , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni , Rob Herring , Simon Horman , Tristram Ha Subject: [PATCH RFC net-next 6/6] net: stmmac: convert to phylink managed WoL PHY speed Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Sun, 28 Sep 2025 09:59:19 +0100 Convert stmmac to use phylink's management of the PHY speed when Wake-on-Lan is enabled. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 5 ----- .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 7 +------ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 15 +-------------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/eth= ernet/stmicro/stmmac/stmmac.h index db4f82672d9a..d10da13ad645 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -376,11 +376,6 @@ enum stmmac_state { =20 extern const struct dev_pm_ops stmmac_simple_pm_ops; =20 -static inline bool stmmac_wol_enabled_phy(struct stmmac_priv *priv) -{ - return !priv->plat->pmt && device_may_wakeup(priv->device); -} - int stmmac_mdio_unregister(struct net_device *ndev); int stmmac_mdio_register(struct net_device *ndev); int stmmac_mdio_reset(struct mii_bus *mii); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers= /net/ethernet/stmicro/stmmac/stmmac_ethtool.c index fd29b551a082..7ab736de308f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -793,13 +793,8 @@ static void stmmac_get_wol(struct net_device *dev, str= uct ethtool_wolinfo *wol) static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *= wol) { struct stmmac_priv *priv =3D netdev_priv(dev); - int ret; =20 - ret =3D phylink_ethtool_set_wol(priv->phylink, wol); - if (!ret) - device_set_wakeup_enable(priv->device, !!wol->wolopts); - - return ret; + return phylink_ethtool_set_wol(priv->phylink, wol); } =20 static int stmmac_ethtool_op_get_eee(struct net_device *dev, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index abe88b74239a..7b4f0c54b9ec 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1189,14 +1189,6 @@ static int stmmac_init_phy(struct net_device *dev) phylink_ethtool_set_eee(priv->phylink, &eee); } =20 - if (!priv->plat->pmt) { - struct ethtool_wolinfo wol =3D { .cmd =3D ETHTOOL_GWOL }; - - phylink_ethtool_get_wol(priv->phylink, &wol); - device_set_wakeup_capable(priv->device, !!wol.supported); - device_set_wakeup_enable(priv->device, !!wol.wolopts); - } - return 0; } =20 @@ -1265,6 +1257,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) config->eee_enabled_default =3D true; } =20 + config->wol_phy_speed_ctrl =3D true; if (priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL) { config->wol_phy_legacy =3D true; } else { @@ -7795,9 +7788,6 @@ int stmmac_suspend(struct device *dev) mutex_unlock(&priv->lock); =20 rtnl_lock(); - if (stmmac_wol_enabled_phy(priv)) - phylink_speed_down(priv->phylink, false); - phylink_suspend(priv->phylink, !!priv->wolopts); rtnl_unlock(); =20 @@ -7936,9 +7926,6 @@ int stmmac_resume(struct device *dev) * workqueue thread, which will race with initialisation. */ phylink_resume(priv->phylink); - if (stmmac_wol_enabled_phy(priv)) - phylink_speed_up(priv->phylink); - rtnl_unlock(); =20 netif_device_attach(ndev); --=20 2.47.3