Re: phy_attach_direct()'s use of device_bind_driver()

From: Andrew Lunn
Date: Fri Feb 12 2021 - 09:06:12 EST


> So the plan to fix this warning is, when device_bind_driver() is called:
> 1. Delete all device links from the device (in this case, the PHY) to
> suppliers that haven't probed yet because there's no probe function
> that can defer at this point.

Just because it currently does not happen, does not mean it couldn't
happen in the future. What are the implications of removing the links?


> 2. Then call the usual device link status update code so that it
> updates the status of the remaining device links correctly. This will
> avoid the warning.
>
> This seems like a generic solution that works for PHY and for any
> device that is force bound.

I don't know if there is any other case in the kernel where a fallback
driver is force bound on a device. But i agree this should be
generic. And hidden away in the drive core, with maybe a new call?

Andrew