Re: [PATCH RFC net-next 4/5] net: phy: introduce is_c45_over_c22 flag
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2022-03-31 11:44:44
Also in:
lkml
On Thu, Mar 24, 2022 at 06:18:14PM +0100, Michael Walle wrote:
Am 2022-03-24 17:23, schrieb Andrew Lunn:quoted
quoted
Isn't it safe to assume that if a PHY implements the indirect registers for c45 in its c22 space that it will also have a valid PHY ID and then the it's driver will be probed?See: https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/phy_device.c#L895 No valid ID in C22 space.I actually looked at the datasheet and yes, it implements the registers 13 and 14 in c22 to access the c45 space. I couldn't find any descriptions of other c22 registers though.
I'm not sure which PHY you're referring to here, but iirc, the later hardware revisions of the 88x3310 implement the indirect access, but earlier revisions do not.
quoted
In general, if the core can do something, it is better than the driver doing it. If the core cannot reliably figure it out, then we have to leave it to the drivers. It could well be we need the drivers to set has_c45. I would prefer that drivers don't touch c45_over_c22 because they don't have the knowledge of what the bus is capable of doing. The only valid case i can think of is for a very oddball PHY which has C45 register space, but cannot actually do C45 transfers, and so C45 over C22 is the only option.And how would you know that the PHY has the needed registers in c22 space? Or do we assume that every C45 PHY has these registers?
That's the problem. Currently C22 PHY drivers that do not support the C45 register space have to set the .read_mmd and .write_mmd methods to genphy_read_mmd_unsupported/genphy_write_mmd_unsupported which effectively disables access to the C45 register space. In order for that to happen, we must have read the C22 PHY ID and bound the driver. That doesn't help with reading the PHY ID though. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!