[PATCH V3] dm: core: Add late driver remove option

Marek Vasut marex at denx.de
Sun Nov 22 03:13:15 CET 2020


On 11/22/20 12:07 AM, Simon Glass wrote:
[...]

>>>>> That way we are describing the property of the device rather than what
>>>>> we want to do with it.
>>>>
>>>> The device is not critical or vital, it just needs to be torn down late.
>>>
>>> What is it about the device that requires it to be torn down 'late'?
>>
>> I think perhaps the problem isn't that it needs to be "late", it's that
>> it has perhaps not obviously described children.  Which gets back to
>> what you just said as well about "later" and "fairly late".  It's an
>> ordering problem.
> 
> Yes it is.
> 
> We currently don't record devices that depend on others. It would be
> possible to add a refcount to DM to cope with this and implement it
> for clocks. I wonder if that might be better than what we have here?

This is still a bootloader, not a general-purpose OS, so I would argue 
we should not complicate this more than is necessary. The DM already 
adds a lot of bloat to U-Boot, no need to make that worse unless there 
is a real good reason for that. Also, in V1 of this patch, Simon did 
suggest that a simple approach is OK if I recall correctly.


More information about the U-Boot mailing list