Netdev List
 help / color / mirror / Atom feed
* [PATCH net] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
@ 2026-07-01  7:57 xiaoning.wang
  2026-07-01  8:11 ` Breno Leitao
  0 siblings, 1 reply; 5+ messages in thread
From: xiaoning.wang @ 2026-07-01  7:57 UTC (permalink / raw)
  To: Frank.Sae, andrew, 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>
---
 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);
+
 	return ret;
 }
 
-- 
2.34.1


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

* Re: [PATCH net] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
  2026-07-01  7:57 [PATCH net] net: phy: motorcomm: read EEE abilities in yt8521_get_features() xiaoning.wang
@ 2026-07-01  8:11 ` Breno Leitao
  2026-07-01  8:16   ` Clark Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Breno Leitao @ 2026-07-01  8:11 UTC (permalink / raw)
  To: xiaoning.wang
  Cc: Frank.Sae, andrew, hkallweit1, linux, davem, edumazet, kuba,
	pabeni, netdev, linux-kernel, imx, xiaoning.wang

On Wed, Jul 01, 2026 at 03:57:30PM +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>
> ---
>  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?

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

* RE: [PATCH net] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
  2026-07-01  8:11 ` Breno Leitao
@ 2026-07-01  8:16   ` Clark Wang
  2026-07-01  8:19     ` Breno Leitao
  2026-07-01 14:32     ` Andrew Lunn
  0 siblings, 2 replies; 5+ messages in thread
From: Clark Wang @ 2026-07-01  8:16 UTC (permalink / raw)
  To: Breno Leitao, Clark Wang (OSS)
  Cc: Frank.Sae@motor-comm.com, andrew@lunn.ch, hkallweit1@gmail.com,
	linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev

> > 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>
> > ---
> >  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.
	 */
"


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

* Re: [PATCH net] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
  2026-07-01  8:16   ` Clark Wang
@ 2026-07-01  8:19     ` Breno Leitao
  2026-07-01 14:32     ` Andrew Lunn
  1 sibling, 0 replies; 5+ messages in thread
From: Breno Leitao @ 2026-07-01  8:19 UTC (permalink / raw)
  To: Clark Wang
  Cc: Clark Wang (OSS), Frank.Sae@motor-comm.com, andrew@lunn.ch,
	hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev

On Wed, Jul 01, 2026 at 08:16:13AM +0000, Clark Wang wrote:
> > > 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>

> > > +	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.
> 	 */
> "

Ack. I've look at the code, and no one is even checking for the return
value anyway.

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

* Re: [PATCH net] net: phy: motorcomm: read EEE abilities in yt8521_get_features()
  2026-07-01  8:16   ` Clark Wang
  2026-07-01  8:19     ` Breno Leitao
@ 2026-07-01 14:32     ` Andrew Lunn
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2026-07-01 14:32 UTC (permalink / raw)
  To: Clark Wang
  Cc: Breno Leitao, Clark Wang (OSS), Frank.Sae@motor-comm.com,
	hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev

On Wed, Jul 01, 2026 at 08:16:13AM +0000, Clark Wang wrote:
> > > 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>
> > > ---
> > >  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?

	Andrew


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

end of thread, other threads:[~2026-07-01 14:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01  7:57 [PATCH net] net: phy: motorcomm: read EEE abilities in yt8521_get_features() xiaoning.wang
2026-07-01  8:11 ` Breno Leitao
2026-07-01  8:16   ` Clark Wang
2026-07-01  8:19     ` Breno Leitao
2026-07-01 14:32     ` Andrew Lunn

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