[PATCH] dm: core: Check flags before removing devices

Simon Glass sjg at chromium.org
Sat Mar 12 03:24:30 CET 2022


Hi Marek,

On Fri, 11 Feb 2022 at 08:24, Marek Vasut <marex at denx.de> wrote:
>
> On 2/11/22 16:05, Simon Glass wrote:
> > Hi Marek,
>
> Hi,
>
> >> Calling device_chld_remove() before flags_remove() means all devices
> >> get removed no matter whether they should be removed late or not. This
> >> breaks teardown of eMMC when booting and other critical boot paths.
> >>
> >> Fixes: c51d2e704a1 ("dm: core: Avoid partially removing devices")
> >> Signed-off-by: Marek Vasut <marex at denx.de>
> >> Cc: Simon Glass <sjg at chromium.org>
> >> ---
> >>   drivers/core/device-remove.c | 16 ++++++++--------
> >>   1 file changed, 8 insertions(+), 8 deletions(-)
> >
> > This means that the children do not get the remove signal if
> > -EPROBE_DEFER or -EKEYREJECTED are returned by the 'dev' device.
> >
> > Also it fails several tests ('make qcheck').
>
> Do you have an idea for a better fix, one which doesn't break booting
> Linux from U-Boot ? I think that's a rather important use-case .

Well the problem is that I don't understand the problem.

Can you explain it in more detail? The commit message does not help
much and you have not added a test for the case you are trying to
enable.

We must remove children before their parents, since children may rely
on their parents to be around until they are removed. This is part of
the device lifecycle as documented.

So what specific devices are children here? Perhaps the output of 'dm
tree' would help.

Regards,
Simon


More information about the U-Boot mailing list