Messages in this thread | | | Date | Tue, 24 Jan 2023 15:41:56 +0100 | From | Michael Walle <> | Subject | Re: [PATCH net-next 0/5] net: phy: C45-over-C22 access |
| |
>> The problem is in the middle. get_phy_c45_devs_in_pkg() uses >> mdiobus_c45_read(). Does mdiobus_c45_read() mean perform a C45 bus >> transaction, or access the C45 address space? I would say it means >> perform a C45 bus transaction. It does not take a phydev, so we are >> below the concept of PHYs, and so C45 over C22 does not exist at this >> level. > > C45-over-C22 is a PHY thing, it isn't generic. We shouldn't go poking > at the PHY C45-over-C22 registers unless we know for certain that the > C22 device we are accessing is a PHY, otherwise we could be writing > into e.g. a switch register or something else. > > So, the mdiobus_* API should be the raw bus API. If we want C45 bus > cycles then mdiobus_c45_*() is the API that gives us that, vs C22 bus > cycles through the non-C45 API. > > C45-over-C22 being a PHY thing is something that should be handled by > phylib, and currently is. The phylib accessors there will use C45 or > C45-over-C22 as appropriate.
I think the crux is get_phy_device(). It is used for two different cases: (1) to scan the mdio bus (2) to add a c45 phy, i.e. in the DT/fwnode case
For (1) we must not use indirect access. And for (2) we know for a fact that it must be a PHY and thus we can (and have to) fall back to c45-over-c22.
Btw. for the DT case, it seems we need yet another property to indicate broken MDIO busses.
-michael
| |