RE: [PATCH net] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
From: Clark Wang
Date: Thu Jul 02 2026 - 23:17:16 EST
> > > > 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@xxxxxxx>
> > > > ---
> > > > drivers/net/phy/motorcomm.c | 3 +++
> > > > 1 file changed, 3 insertions(+)
> > > >
> > > > diff --git a/drivers/net/phy/motorcomm.c
> > > b/drivers/net/phy/motorcomm.c
> > > > index b49897500a59..46efa3406841 100644
> > > > --- a/drivers/net/phy/motorcomm.c
> > > > +++ b/drivers/net/phy/motorcomm.c
> > > > @@ -2439,6 +2439,9 @@ static int yt8521_get_features(struct
> > > > phy_device
> > > *phydev)
> > > > /* add fiber's features to phydev->supported */
> > > > yt8521_prepare_fiber_features(phydev, phydev->supported);
> > > > }
> > > > +
> > > > + genphy_c45_read_eee_abilities(phydev);
> > >
> > > Don't you want to return error if genphy_c45_read_eee_abilities() fails?
> >
> > EEE is an optional functionality, and the call in genphy_read_abilities() has
> the following comment. Therefore, I do not return its error here either.
> > "
> > /* This is optional functionality. If not supported, we may get an error
> > * which should be ignored.
> > */
> > "
>
> This conversation then raises the question, should this be a void function?
>
Hi Andrew and Breno,
On second thought, I think it should stay int. The "ignore errors" rationale
in phy_device.c applies to the generic path where the PHY may not have EEE
registers at all. But if this function is called within a specific PHY driver which
we have already confirmed its support for EEE, need to handle the potential
MDIO bus errors.
If there's no problem. I'll send a v2 that changes the call to:
return ret ? : genphy_c45_read_eee_abilities(phydev);
Thanks!
Clark