Netdev List
 help / color / mirror / Atom feed
* [PATCH net V3] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
@ 2026-07-17  9:16 xiaoning.wang
  2026-07-17 10:21 ` Clark Wang
  0 siblings, 1 reply; 2+ messages in thread
From: xiaoning.wang @ 2026-07-17  9:16 UTC (permalink / raw)
  To: Frank.Sae, andrew, leitao, hkallweit1, linux, davem, edumazet,
	kuba, pabeni
  Cc: netdev, linux-kernel, imx, Clark Wang

From: Clark Wang <xiaoning.wang@nxp.com>

In phy_probe(), genphy_c45_read_eee_abilities() is only called when a
driver uses phydrv->features. Drivers that implement .get_features are
responsible for reading the EEE abilities themselves.

yt8521_get_features() does not do this, so phydev->supported_eee stays
empty for YT8521/YT8531S and "ethtool --show-eee" reports "EEE status:
not supported", even though the PHY has the standard EEE capability
registers.

Call genphy_c45_read_eee_abilities() at the end of yt8521_get_features()
to populate supported_eee.

Fixes: 70479a40954c ("net: phy: Add driver for Motorcomm yt8521 gigabit ethernet phy")
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
---
V3 changes:
- Replace the uncommon "ret ? : ..." expression with the usual
  check, and move the check right after the first yt8521_get_features_paged()
  call, which was the only path missing it.
- Collect Reviewed tag from Breno.

V2 changes:
- Return the value from genphy_c45_read_eee_abilities.
---
 drivers/net/phy/motorcomm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
index 5071605a1a11..6b710c02264e 100644
--- a/drivers/net/phy/motorcomm.c
+++ b/drivers/net/phy/motorcomm.c
@@ -2481,6 +2481,8 @@ static int yt8521_get_features(struct phy_device *phydev)
 
 	if (priv->reg_page != YT8521_RSSR_TO_BE_ARBITRATED) {
 		ret = yt8521_get_features_paged(phydev, priv->reg_page);
+		if (ret < 0)
+			return ret;
 	} else {
 		ret = yt8521_get_features_paged(phydev,
 						YT8521_RSSR_UTP_SPACE);
@@ -2490,7 +2492,8 @@ static int yt8521_get_features(struct phy_device *phydev)
 		/* add fiber's features to phydev->supported */
 		yt8521_prepare_fiber_features(phydev, phydev->supported);
 	}
-	return ret;
+
+	return genphy_c45_read_eee_abilities(phydev);
 }
 
 /**
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH net V3] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
  2026-07-17  9:16 [PATCH net V3] net: phy: motorcomm: read EEE abilities in yt8521_get_features() xiaoning.wang
@ 2026-07-17 10:21 ` Clark Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Clark Wang @ 2026-07-17 10:21 UTC (permalink / raw)
  To: Clark Wang (OSS), Frank.Sae@motor-comm.com, andrew@lunn.ch,
	leitao@debian.org, hkallweit1@gmail.com, linux@armlinux.org.uk,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev

> From: Clark Wang <xiaoning.wang@nxp.com>
> 
> In phy_probe(), genphy_c45_read_eee_abilities() is only called when a
> driver uses phydrv->features. Drivers that implement .get_features are
> responsible for reading the EEE abilities themselves.
> 
> yt8521_get_features() does not do this, so phydev->supported_eee stays
> empty for YT8521/YT8531S and "ethtool --show-eee" reports "EEE status:
> not supported", even though the PHY has the standard EEE capability
> registers.
> 
> Call genphy_c45_read_eee_abilities() at the end of yt8521_get_features()
> to populate supported_eee.
> 
> Fixes: 70479a40954c ("net: phy: Add driver for Motorcomm yt8521 gigabit
> ethernet phy")
> Reviewed-by: Breno Leitao <leitao@debian.org>
> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
> ---
> V3 changes:
> - Replace the uncommon "ret ? : ..." expression with the usual
>   check, and move the check right after the first
> yt8521_get_features_paged()
>   call, which was the only path missing it.
> - Collect Reviewed tag from Breno.
> 
> V2 changes:
> - Return the value from genphy_c45_read_eee_abilities.
> ---

Sorry for the noise.
I think sashiko's discovery on V2 makes sense. I will fix the issues mentioned in V4.
https://sashiko.dev/#/patchset/20260710080018.1070789-1-xiaoning.wang@oss.nxp.com?part=1

Best regards,
Clark Wang

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-17 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17  9:16 [PATCH net V3] net: phy: motorcomm: read EEE abilities in yt8521_get_features() xiaoning.wang
2026-07-17 10:21 ` Clark Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox