Re: [PATCH v2 net-next 3/3] net: phy: aquantia: add support for aqr115c

From: Bartosz Golaszewski
Date: Thu Jun 27 2024 - 08:18:31 EST


On Thu, Jun 27, 2024 at 2:09 PM Russell King (Oracle)
<linux@xxxxxxxxxxxxxxx> wrote:
>
> On Thu, Jun 27, 2024 at 01:30:17PM +0200, Bartosz Golaszewski wrote:
> > +static int aqr115c_config_init(struct phy_device *phydev)
> > +{
> > + /* Check that the PHY interface type is compatible */
> > + if (phydev->interface != PHY_INTERFACE_MODE_SGMII &&
> > + phydev->interface != PHY_INTERFACE_MODE_2500BASEX)
> > + return -ENODEV;
> > +
> > + phy_set_max_speed(phydev, SPEED_2500);
>
> Please can you explain why this is necessary? Does the PHY report that
> it incorrectly supports faster speeds than 2500base-X ?
>
> If phylib is incorrectly detecting the PHYs features, then this should
> be corrected via the .get_features method, not in the .config_init
> method.
>
> (The same should be true of the other Aquantia PHYs.)
>
> Note that phy_set_max_speed() is documented as:
>
> * The PHY might be more capable than the MAC. For example a Fast Ethernet
> * is connected to a 1G PHY. This function allows the MAC to indicate its
> * maximum speed, and so limit what the PHY will advertise.
>

Well I should have RTFM. You're right, I'll drop it.

Bart

> Aquantia seems to be the only PHY driver that calls this function.
>
> Thanks.
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!