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

Simon Glass sjg at chromium.org
Thu Jan 7 13:56:07 CET 2021


Hi Marek,

On Thu, 7 Jan 2021 at 05:42, Marek Vasut <marex at denx.de> wrote:
>
> On 12/10/20 6:44 PM, Simon Glass wrote:
>
> [...]
>
> >>>>> Note also the semantics of what is going on here. The idea of the
> >>>>> existing OS_PREPARE and ACTIVE_DMA flags is that the default for
> >>>>> device_remove() is to remove everything, but if you provide a flag
> >>>>> then it just removes those things. Your flag is the opposite to that,
> >>>>> which is why you are changing so much code.
> >>>>
> >>>> I obviously cannot remove everything, see the example above.
> >>>
> >>> Do you understand what I am saying about inverting the flag?
> >>
> >> No, please elaborate.
> >
> > The normal situation should be to remove everything. Removing only
> > non-late things (which I want to call 'basic', or something like that)
> > should be an option, like we have DM_REMOVE_OS_PREPARE.
>
> We cannot remove everything at once, because then various real hardware
> cannot work properly. So there needs to be some way to remove e.g. the
> clock drivers later. Marking a couple of drivers as "remove-late" is
> much less intrusive than marking most drivers as "do-not-remove-early".

I'm not suggesting marking drivers as 'do not remove early'. I am
referring to the parameter of the device_remove() function. Mostly
what I am asking for is better naming, and (I hope) a simpler
implementation.

>
> How do you propose this "inverted" remove flag would look like ?

Similar to the existing flags. See for example DM_FLAG_ACTIVE_DMA.

I have this on my list to look at more closely and should do so in the
next week.

Regards,
Simon


More information about the U-Boot mailing list