Dave Johnson writes: > If I list the phy as discoverable, it isn't detected as the > clocks/reset aren't setup: > > compatible = "ethernet-phy-ieee802.3-c22"; > > [ 1.273000] mdio_bus stmmac-0: MDIO device at address 0 is missing. > > > Or if I list the phy specifically, mdiobus_register_clock() does get > called, but mdio_device_toggle_clock() is never called: > > compatible = "ethernet-phy-id001c.c816"; > > [ 1.448000] mdio_bus stmmac-0:00: Resources present before probing >
OK, I've found the problem. The patch mentioned https://oftc.irclog.whitequark.org/linux-sunxi/2023-02-14 seems incomplete. The assumption that clocks only need to be enabled/disabled at mdio_probe()/mdio_remove() isn't correct. mdio_device_reset() is also called from phy_device_reset() and those calls are the only ones prior to probe, so probing for the phy needs the clocks too. When mdio_device_reset() is called from phy_device_reset() we also need to enable/disable clocks along with the reset. The previous mdio_device_toggle_clock() also resulted in some warnings as it tried to disable clocks when they were already disabled, something the clock subsystem doesn't like. Will throw together a patch shortly. -- Dave -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/25964.53422.491115.864965%40gargle.gargle.HOWL.