Re: [PATCH net-next] net: phy: aquantia: Add mdix config and reporting

From: Paul Davey
Date: Thu Oct 17 2024 - 19:52:26 EST


On Thu, 2024-10-17 at 12:54 +0100, Daniel Golle wrote:
> On Thu, Oct 17, 2024 at 02:54:07PM +1300, Paul Davey wrote:
> > Add support for configuring MDI-X state of PHY.
> > Add reporting of resolved MDI-X state in status information.
>
> > [...]
> > +static int aqr_set_polarity(struct phy_device *phydev, int
> > polarity)
>
> "polarity" is not the right term here. This is not about the polarity
> of copper pairs, but rather about pairs being swapped.
> Please name the function accordingly, eg. aqr_set_mdix().

I will fix the name in the next version.

> [...]
> According to the datasheet the MDI/MDI-X indication should only be
> interpreted when autonegotiation has completed.
> Hence this call should be protected by genphy_c45_aneg_done(phydev)
> and
> phydev->mdix set to ETH_TP_MDI_INVALID in case auto-negotiation
> hasn't
> completed.

I will add a guard by this. I did some testing because I was concerned
with what the behaviour is when disabling auto-negotiation, and have
concluded that auto MDI/MDI-X detection does not occur if auto-negotion
is disabled.

Due to this I wonder whether the mdix configuration should reject
ETH_TP_MDI_AUTO if auto-negotiation is disabled?

> [...]
> >