From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Christophe Roullier <christophe.roullier@foss.st.com>,
Conor Dooley <conor+dt@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
devicetree@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>, Simon Horman <horms@kernel.org>,
Tristram Ha <Tristram.Ha@microchip.com>
Subject: [PATCH net-next v2 6/6] net: stmmac: convert to phylink managed WoL PHY speed
Date: Thu, 23 Oct 2025 10:16:55 +0100 [thread overview]
Message-ID: <E1vBrRH-0000000BLzm-3JjF@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <aPnyW54J80h9DmhB@shell.armlinux.org.uk>
Convert stmmac to use phylink's management of the PHY speed when
Wake-on-Lan is enabled.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
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/ethernet/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 {
extern const struct dev_pm_ops stmmac_simple_pm_ops;
-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, struct ethtool_wolinfo *wol)
static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct stmmac_priv *priv = netdev_priv(dev);
- int ret;
- ret = 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);
}
static int stmmac_ethtool_op_get_eee(struct net_device *dev,
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/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);
}
- if (!priv->plat->pmt) {
- struct ethtool_wolinfo wol = { .cmd = 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;
}
@@ -1281,6 +1273,7 @@ static int stmmac_phylink_setup(struct stmmac_priv *priv)
config->eee_enabled_default = true;
}
+ config->wol_phy_speed_ctrl = true;
if (priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL) {
config->wol_phy_legacy = true;
} else {
@@ -7795,9 +7788,6 @@ int stmmac_suspend(struct device *dev)
mutex_unlock(&priv->lock);
rtnl_lock();
- if (stmmac_wol_enabled_phy(priv))
- phylink_speed_down(priv->phylink, false);
-
phylink_suspend(priv->phylink, !!priv->wolopts);
rtnl_unlock();
@@ -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();
netif_device_attach(ndev);
--
2.47.3
next prev parent reply other threads:[~2025-10-23 9:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 9:16 [PATCH net-next v2 0/6] net: add phylink managed WoL and convert stmmac Russell King (Oracle)
2025-10-23 9:16 ` [PATCH net-next v2 1/6] net: phy: add phy_can_wakeup() Russell King (Oracle)
2025-10-23 9:16 ` [PATCH net-next v2 2/6] net: phy: add phy_may_wakeup() Russell King (Oracle)
2025-10-23 9:16 ` [PATCH net-next v2 3/6] net: phylink: add phylink managed MAC Wake-on-Lan support Russell King (Oracle)
2025-10-23 9:16 ` [PATCH net-next v2 4/6] net: phylink: add phylink managed wake-on-lan PHY speed control Russell King (Oracle)
2025-10-23 9:16 ` [PATCH net-next v2 5/6] net: stmmac: convert to phylink-managed Wake-on-Lan Russell King (Oracle)
2025-10-23 9:16 ` Russell King (Oracle) [this message]
2025-10-25 2:10 ` [PATCH net-next v2 0/6] net: add phylink managed WoL and convert stmmac patchwork-bot+netdevbpf
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=E1vBrRH-0000000BLzm-3JjF@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=Tristram.Ha@microchip.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=christophe.roullier@foss.st.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
/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