Re: [PATCH net-next 4/5] phy: net: introduce phy_promote_to_c45()

From: Michael Walle
Date: Fri Jan 20 2023 - 18:28:02 EST


Am 2023-01-21 00:20, schrieb Russell King (Oracle):
On Fri, Jan 20, 2023 at 11:40:10PM +0100, Michael Walle wrote:
If not explitly asked to be probed as a C45 PHY, on a bus which is
capable of doing both C22 and C45 transfers, C45 PHYs are first tried to
be probed as C22 PHYs. To be able to promote the PHY to be a C45 one,
the driver can call phy_promote_to_c45() in its probe function.

This was already done in the mxl-gpy driver by the following snippet:

if (!phydev->has_c45) {
ret = phy_get_c45_ids(phydev);
if (ret < 0)
return ret;
}

Move that code into the core by creating a new function
phy_promote_to_c45(). If a PHY is promoted, C45-over-C22 access is used,
regardless if the bus supports C45 or not. That is because there might
be C22 PHYs on the bus which gets confused by C45 accesses.

It is my understanding that C45 PHYs do not have to respond to C22
accesses. So, wouldn't this lead to some C45 PHYs not being detected?

In that case, the PHY already has to be a C45 PHY, correct? Because
no access to c22 means, it can't be probed as a c22 phy; therefore,
it has the has_c45 set to true. Then phy_promote_to_c45() is a noop and
c45-over-c22 wont be set.

-michael