* [PATCH net V2] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
@ 2026-07-10 8:00 xiaoning.wang
2026-07-10 8:19 ` Breno Leitao
2026-07-10 13:12 ` Andrew Lunn
0 siblings, 2 replies; 4+ messages in thread
From: xiaoning.wang @ 2026-07-10 8:00 UTC (permalink / raw)
To: Frank.Sae, andrew, leitao, hkallweit1, linux, davem, edumazet,
kuba, pabeni
Cc: netdev, linux-kernel, imx, xiaoning.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")
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
---
V2 change:
- Since both the YT8521 and YT8531s, which call the yt8521_get_features(),
support EEE, if genphy_c45_read_eee_abilities() returns an error, it
indicates a problem with MDIO bus, and the error should be returned
accordingly.
---
drivers/net/phy/motorcomm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
index 5071605a1a11..73b5da937d7f 100644
--- a/drivers/net/phy/motorcomm.c
+++ b/drivers/net/phy/motorcomm.c
@@ -2490,7 +2490,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 ret ? ret : genphy_c45_read_eee_abilities(phydev);
}
/**
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net V2] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
2026-07-10 8:00 [PATCH net V2] net: phy: motorcomm: read EEE abilities in yt8521_get_features() xiaoning.wang
@ 2026-07-10 8:19 ` Breno Leitao
2026-07-10 13:12 ` Andrew Lunn
1 sibling, 0 replies; 4+ messages in thread
From: Breno Leitao @ 2026-07-10 8:19 UTC (permalink / raw)
To: xiaoning.wang
Cc: Frank.Sae, andrew, hkallweit1, linux, davem, edumazet, kuba,
pabeni, netdev, linux-kernel, imx, xiaoning.wang
On Fri, Jul 10, 2026 at 04:00:18PM +0800, xiaoning.wang@oss.nxp.com wrote:
> 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")
> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net V2] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
2026-07-10 8:00 [PATCH net V2] net: phy: motorcomm: read EEE abilities in yt8521_get_features() xiaoning.wang
2026-07-10 8:19 ` Breno Leitao
@ 2026-07-10 13:12 ` Andrew Lunn
2026-07-17 9:06 ` Clark Wang (OSS)
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2026-07-10 13:12 UTC (permalink / raw)
To: xiaoning.wang
Cc: Frank.Sae, leitao, hkallweit1, linux, davem, edumazet, kuba,
pabeni, netdev, linux-kernel, imx, xiaoning.wang
> @@ -2490,7 +2490,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 ret ? ret : genphy_c45_read_eee_abilities(phydev);
Using a ? like this is very uncommon.
Please change it to the usual
if (ret < 0)
return ret;
return genphy_c45_read_eee_abilities(phydev);
It might also be better to put the test after
yt8521_get_features_paged() call, since that is the only place missing
the test.
Andrew
---
pw-bot: cr
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH net V2] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
2026-07-10 13:12 ` Andrew Lunn
@ 2026-07-17 9:06 ` Clark Wang (OSS)
0 siblings, 0 replies; 4+ messages in thread
From: Clark Wang (OSS) @ 2026-07-17 9:06 UTC (permalink / raw)
To: Andrew Lunn
Cc: Frank.Sae, leitao, hkallweit1, linux, davem, edumazet, kuba,
pabeni, netdev, linux-kernel, Clark Wang (OSS),
imx, Clark Wang
> > @@ -2490,7 +2490,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 ret ? ret : genphy_c45_read_eee_abilities(phydev);
>
> Using a ? like this is very uncommon.
>
> Please change it to the usual
>
> if (ret < 0)
> return ret;
>
> return genphy_c45_read_eee_abilities(phydev);
>
> It might also be better to put the test after
> yt8521_get_features_paged() call, since that is the only place missing the
> test.
Hi Andrew,
Sorry, I missed your email. Yes, your suggestion is good, it looks more usual that way.
I will send V3.
Thank you very much!
Best Regards,
Clark Wang
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-17 9:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-10 8:00 [PATCH net V2] net: phy: motorcomm: read EEE abilities in yt8521_get_features() xiaoning.wang
2026-07-10 8:19 ` Breno Leitao
2026-07-10 13:12 ` Andrew Lunn
2026-07-17 9:06 ` Clark Wang (OSS)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome