Re: Clause 45 and Clause 22 PHYs on one MDIO bus

From: Andrew Lunn
Date: Mon Mar 21 2022 - 16:36:41 EST


> Actually, it looks like mdiobus_c45_read() is really c45 only and only
> used for PHYs which just support c45 and not c45-over-c22 (?). I was
> mistaken by the heavy use of the function in phy_device.c. All the
> methods in phy-c45.c use phy_*_mmd() functions. Thus it might only be
> the mxl-gpy doing something fishy in its probe function.

Yes, there is something odd here. You should search back on the
mailing list.

If i remember correctly, it is something like it responds to both c22
and c45. If it is found via c22, phylib does not set phydev->is_c45,
and everything ends up going indirect. So the probe additionally tries
to find it via c45? Or something like that.

> Nevertheless, I'd still need the opt-out of any c45 access. Otherwise,
> if someone will ever implement c45 support for the mdio-mscc-mdio
> driver, I'll run in the erratic behavior.

Yah, i need to think about that. Are you purely in the DT world, or is
ACPI also an option?

Maybe extend of_mdiobus_register() to look for a DT property to limit
what values probe_capabilities can take?

Andrew