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

Tom Rini trini at konsulko.com
Mon Nov 23 19:48:46 CET 2020


On Sun, Nov 22, 2020 at 03:13:15AM +0100, Marek Vasut wrote:
> 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.

Perhaps now that it's clear to everyone what "late" means in this
context, we can just solve it with a flag + documentation that
...whatever the name is... means that it's for ensuring that we have
unwound the other parts of the system which require this to be enabled
first.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201123/d9aeb5e3/attachment.sig>


More information about the U-Boot mailing list