Hi!
When registering mdiobus children, if we get an -EPROBE_DEFER, we shouldn't ignore it and continue registering the rest of the mdiobus children. This would permanently prevent the deferring child mdiobus from working instead of reattempting it in the future. So, if a child mdiobus needs to be reattempted in the future, defer the entire mdio-mux initialization.
This fixes the issue where PHYs sitting under the mdio-mux aren't initialized correctly if the PHY's interrupt controller is not yet ready when the mdio-mux is being probed. Additional context in the link below.
I don't believe this is quite right. AFAICT it leaks memory in the EPROBE_DEFER case. Could someone double-check? Suggested fix is below.
devm_ APIs would take care of releasing the resource (memory) automatically because the probe didn't succeed. So I'm not sure there's a leak. Does that make sense?
Yes, it does, I believe you are right.
This part of code confused me: We are going to return error there, yet we do explicit tree, which should not be neccessary according to this logic.
dev_err(dev, "Error: No acceptable child buses found\n"); devm_kfree(dev, pb);
Best regards, Pavel