Re: [PATCH net-next 0/5] net: phy: C45-over-C22 access

From: Michael Walle
Date: Tue Jan 24 2023 - 16:20:41 EST


Am 2023-01-24 22:03, schrieb Andrew Lunn:
Btw. for the DT case, it seems we need yet another property
to indicate broken MDIO busses.

I would prefer to avoid that. I would suggest you do what i did for
the none DT case. First probe using C22 for all devices known in DT.
Then call mdiobus_prevent_c45_scan() which will determine if any of
the found devices are FUBAR and will break C45. Then do a second probe
using C45 and/or C45 over C22 for those devices in DT with the c45
compatible.

I tried that yesterday. Have a look at of_mdiobus_register() [1].
There the device tree is walked and each PHY with a reg property
is probed. Afterwards, if there was a node without a reg property,
the bus is scanned for the missing PHYs. If we would just probe c22
first, the order of the auto scanning might change, if there is a
c45 phy in between two c22 phys. I was thinking to just ignore the
case that the autoscan would discover a broken PHY.

(1) scan c22
(2) scan c45 (maybe using c45-over-c22)
(3) do the autoscan

-michael

[1] https://elixir.bootlin.com/linux/v6.2-rc5/source/drivers/net/mdio/of_mdio.c#L149




Andrew