From nobody Wed Dec 17 10:44:40 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 A71242FD7A5; Thu, 23 Oct 2025 09:17:11 +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=1761211033; cv=none; b=Yk50/IgFo7gaMZ7zuoa4yg/zTpjKD6we4TSuzZHGM0Lh0UZAc3kNCik6HocFLB26qWMbyztJnMKfa+WdaVt93A0KeuJy1Cb9Ej0rCkrRQn41iuP9CWpCphMqqMVah5hceKPLX8jFzTgf0od5uxG81GJSLkayLTeYilyihMqmxeo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761211033; c=relaxed/simple; bh=BaB/XZhFu753IVYghIbyLEqXUpXhWf2fgCL2JKj5xmY=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=cqm1XD0brn9mf8ck+oPO1LFJkYdOlUswdogtu0xazXH90mIniNLjxO1E+2O3QOAGAUuicPl/pkBoiQWcfFWYDJmRLVikLxsclgaEnFO5RjZl2SVqj/N67G9g4VDxFXTw4gqBUh9mOQTF0MvmanfMjBlRC7xTVCkHFz3TdwsS/ZY= 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=Y38kwf1Z; 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="Y38kwf1Z" 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=p8nGj97eGYTfPod9ayjRGJmFdOdrPYx1iYFTpsb7YyU=; b=Y38kwf1ZcEXlS3x3iHyV8S9EUn Mn6lT0Gc0MdsX2vyeLM2xfZs+2vdCxZElGOxiRYVIV8yTOu57NspfkHM/CfMjBAvqRITlYVZBYHYy COeqHWFzoSjrZlJtmWsJOzlD/oaJN16CVZTs8/DJDb0ADuB6i785Rn+iXWysOPYxjk0L3XiyYnczf uN5XsMXKru+QoLsK1W1rOst8zs+6pYRfeTOacZlyECYzlxuODxDzBC+vAXGonKYbcvfyeS59e5i6n 3e9cSVBdBqIbuh0tSSwPvuZ1OYVwgzCn2WlL97KiHdj5K2QhUHGds+518uzbPboMBHsUVa1H5RLGB S8aQNZSQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:57406 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 1vBrRM-0000000062N-0xrQ; Thu, 23 Oct 2025 10:17:00 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vBrRH-0000000BLzm-3JjF; Thu, 23 Oct 2025 10:16:55 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , Christophe Roullier , Conor Dooley , "David S. Miller" , devicetree@vger.kernel.org, Eric Dumazet , 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 net-next v2 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: Thu, 23 Oct 2025 10:16:55 +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 f128d25346a9..d5af9344dfb0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -380,11 +380,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 08b570bc60c7..b155e71aac51 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -730,13 +730,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 af4eb94f0f4f..fd5106880192 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1205,14 +1205,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 @@ -1281,6 +1273,7 @@ static int stmmac_phylink_setup(struct stmmac_priv *p= riv) 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