[PATCH net-next v2 8/8] net: fec: Indicate EEE (LPI) support for some FEC Ethernet controllers

Oleksij Rempel posted 8 patches 2 years, 10 months ago
[PATCH net-next v2 8/8] net: fec: Indicate EEE (LPI) support for some FEC Ethernet controllers
Posted by Oleksij Rempel 2 years, 10 months ago
This commit adds EEE (LPI) support indication for specific FEC Ethernet
controllers. By indicating EEE support for these controllers, it allows
PHY drivers to choose the right configuration for EEE and LPI features,
depending on whether the MAC or the PHY is responsible for handling them.

This change provides more flexibility and control over energy-saving
features, enabling PHY drivers to disable SmartEEE functionality in favor
of MAC EEE support when appropriate, depending on their specific use cases
and requirements.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/ethernet/freescale/fec_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index f3b16a6673e2..554a5dc92817 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2318,6 +2318,8 @@ static int fec_enet_mii_probe(struct net_device *ndev)
 	fep->link = 0;
 	fep->full_duplex = 0;
 
+	if (fep->quirks & FEC_QUIRK_HAS_EEE)
+		phy_dev->mac_supports_eee = true;
 	phy_dev->mac_managed_pm = true;
 
 	phy_attached_info(phy_dev);
-- 
2.30.2
RE: [PATCH net-next v2 8/8] net: fec: Indicate EEE (LPI) support for some FEC Ethernet controllers
Posted by Wei Fang 2 years, 10 months ago
> -----Original Message-----
> From: Oleksij Rempel <o.rempel@pengutronix.de>
> Sent: 2023年3月27日 22:22
> To: Wei Fang <wei.fang@nxp.com>; David S. Miller <davem@davemloft.net>;
> Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>;
> Paolo Abeni <pabeni@redhat.com>; Andrew Lunn <andrew@lunn.ch>; Heiner
> Kallweit <hkallweit1@gmail.com>; Russell King <linux@armlinux.org.uk>
> Cc: Oleksij Rempel <o.rempel@pengutronix.de>; kernel@pengutronix.de;
> linux-kernel@vger.kernel.org; netdev@vger.kernel.org; Shenwei Wang
> <shenwei.wang@nxp.com>; Clark Wang <xiaoning.wang@nxp.com>;
> dl-linux-imx <linux-imx@nxp.com>; Amit Cohen <amcohen@nvidia.com>; Gal
> Pressman <gal@nvidia.com>; Alexandru Tachici
> <alexandru.tachici@analog.com>; Piergiorgio Beruto
> <piergiorgio.beruto@gmail.com>; Willem de Bruijn <willemb@google.com>;
> Vladimir Oltean <vladimir.oltean@nxp.com>
> Subject: [PATCH net-next v2 8/8] net: fec: Indicate EEE (LPI) support for some
> FEC Ethernet controllers
> 
> This commit adds EEE (LPI) support indication for specific FEC Ethernet
> controllers. By indicating EEE support for these controllers, it allows PHY
> drivers to choose the right configuration for EEE and LPI features, depending
> on whether the MAC or the PHY is responsible for handling them.
> 
> This change provides more flexibility and control over energy-saving features,
> enabling PHY drivers to disable SmartEEE functionality in favor of MAC EEE
> support when appropriate, depending on their specific use cases and
> requirements.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Reviewed-by: Wei Fang <wei.fang@nxp.com>