Subject: Re: [PATCH RFC net-next 2/7] net: dsa: no longer call ds->ops->get_mac_eee()

From: "Russell King (Oracle)" <[email-masked]>
Date: Thu, 2 Jan 2025 17:56:59 +0000

On Thu, Dec 12, 2024 at 09:44:19PM +0200, Vladimir Oltean wrote:
> On Tue, Dec 10, 2024 at 02:26:19PM +0000, Russell King (Oracle) wrote:
> >  	/* Check whether the switch supports EEE */
> >  	if (!ds->ops->support_eee || !ds->ops->support_eee(ds, dp->index))
> >  		return -EOPNOTSUPP;
> >  
> > -	/* Port's PHY and MAC both need to be EEE capable */
> > -	if (!dev->phydev)
> > -		return -ENODEV;
> 
> It may well be that removing this test is ok given the later call to
> phylink_ethtool_get_eee() which will fail with the same return code,
> but this change does not logically pertain to a patch titled
> "no longer call ds->ops->get_mac_eee()", and no justification is brought
> for it in the commit message (my previous sentence should be sufficient).
> Please move this to a separate patch, for traceability purposes.

Let's say we split this from the patch, and leave the check in place for
this patch.

We then end up with:

	/* Port's PHY and MAC both need to be EEE capable */
	if (!dev->phydev)
		return -ENODEV;

	return phylink_ethtool_get_eee(dp->pl, e);

here.

At this point, we end up with this code:

	if (!dev->phydev)
		return -ENODEV;
followed by:
	ret = -EOPNOTSUPP;

	if (pl->phydev)
		ret = phy_ethtool_get_eee(pl->phydev, eee);

	return ret;

You seem to want that, so I'll drop the removal of this from the patch
series, especially as it changes the error that userspace sees - even
though it's different from what other ethernet drivers do. If we want
to address the !phydev return code issue, that can be done some other
time.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!