
This is an attempt to come up with a 'late removal' feature, as implemented by Marek, but using different terminology and trying to fit in with the existing removal flags.
I have taken the opportunity to clean up a few related things.
The series is available at u-boot-dm/late-working
The previous patch was here:
http://patchwork.ozlabs.org/project/uboot/patch/20201108140818.55172-1-marek...
Changes in v5: - Change logic to allow flags to be combined - Add patch to remove vital devices last
Changes in v4: - Use 'vital' rather than 'late' as the description - Invert the removal flag to DM_REMOVE_NON_VITAL, to avoid the need for two-pass processing in the bowels of driver model - Simplify the test to only test 'vital' - Drop the change to uclass_destroy() - Revised and updated based on discussion
Marek Vasut (1): dm: core: Add late driver remove option
Simon Glass (8): smem: Don't use -EPROBE_DEFER nand: brcmnand: Don't use -EPROBE_DEFER dm: Rename DM_FLAG_REMOVE_WITH_PD_ON dm: pci: Correct use of wrong flag name dm: core: Remove children before advising uclass dm: core: Avoid partially removing devices arm: Remove vital devices last dm: core: Add documentation about device removal
arch/arm/lib/bootm.c | 3 + doc/driver-model/design.rst | 20 +++++ drivers/core/device-remove.c | 96 +++++++++++++++++------- drivers/core/root.c | 2 + drivers/mtd/nand/raw/brcmnand/brcmnand.c | 5 +- drivers/pci/pcie_iproc.c | 2 +- drivers/smem/msm_smem.c | 6 +- drivers/video/meson/meson_vpu.c | 2 +- drivers/watchdog/rti_wdt.c | 2 +- include/dm/device-internal.h | 15 +++- include/dm/device.h | 15 +++- test/dm/core.c | 94 +++++++++++++++++++++++ test/dm/test-driver.c | 22 ++++++ test/dm/virtio.c | 4 +- 14 files changed, 244 insertions(+), 44 deletions(-)