u-boot/test/dm
Janne Grunau dabaa4ae32 dm: Add dm_remove_devices_active() for ordered device removal
This replaces dm_remove_devices_flags() calls in all boot
implementations to ensure non vital devices are consistently removed
first. All boot implementation except arch/arm/lib/bootm.c currently
just call dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL). This can result
in crashes when dependencies between devices exists. The driver model's
design document describes DM_FLAG_VITAL as "indicates that the device is
'vital' to the operation of other devices". Device removal at boot
should follow this.

Instead of adding dm_remove_devices_flags() with (DM_REMOVE_ACTIVE_ALL |
DM_REMOVE_NON_VITAL) everywhere add dm_remove_devices_active() which
does this.

Fixes a NULL pointer deref in the apple dart IOMMU driver during EFI
boot. The xhci-pci (driver which depends on the IOMMU to work) removes
its mapping on removal. This explodes when the IOMMU device was removed
first.

dm_remove_devices_flags() is kept since it is used for testing of
device_remove() calls in dm.

Signed-off-by: Janne Grunau <j@jannau.net>
2024-11-24 15:41:28 -06:00
..
acpi.c acpi: Add fill_madt to acpi_ops 2024-10-27 17:24:13 -06:00
acpi.h doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
acpi_dp.c include: export uuid.h 2024-09-12 17:35:37 +02:00
acpigen.c include: export uuid.h 2024-09-12 17:35:37 +02:00
adc.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
audio.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
axi.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
blk.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
blkmap.c test: dm: Use UTF_CONSOLE in tests 2024-08-26 18:51:49 -06:00
bootcount.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
bus.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
button.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
cache.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
clk.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
clk_ccf.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
core.c dm: Add dm_remove_devices_active() for ordered device removal 2024-11-24 15:41:28 -06:00
cpu.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
cros_ec.c test: dm: Use UTF_CONSOLE in tests 2024-08-26 18:51:49 -06:00
cros_ec_pwm.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
devres.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
dma.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
dsa.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
dsi_host.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
ecdsa.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
efi_media.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
eth.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
extcon.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
fastboot.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
fdtdec.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
ffa.c test: Rename UTF_CONSOLE_REC to UTF_CONSOLE 2024-08-26 18:51:49 -06:00
firmware.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
fpga.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
fwu_mdata.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
fwu_mdata_disk_image.h test: dm: Add test cases for FWU Metadata uclass 2022-10-31 14:47:33 -04:00
gpio.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
host.c test: dm: Use UTF_CONSOLE in tests 2024-08-26 18:51:49 -06:00
hwspinlock.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
i2c.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
i2s.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
iommu.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
irq.c drivers: misc: irq-uclass: Update irq_get_by_index 2024-10-27 17:24:13 -06:00
k210_pll.c test: Remove <common.h> and add needed includes 2024-05-06 15:05:04 -06:00
Kconfig
led.c test: dm: Add tests for LED boot and activity 2024-10-10 16:02:20 -06:00
mailbox.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
Makefile net: introduce alternative implementation as net/lwip/ 2024-10-16 11:11:56 -06:00
mdio.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
mdio_mux.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
memory.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
misc.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
mmc.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
mux-cmd.c test: dm: Use UTF_CONSOLE in tests 2024-08-26 18:51:49 -06:00
mux-emul.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
mux-mmio.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
nand.c test: Update NAND test to avoid extra macros 2024-08-26 18:51:49 -06:00
nop.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
nvmxip.c test: Rename UTF_CONSOLE_REC to UTF_CONSOLE 2024-08-26 18:51:49 -06:00
of_extra.c test: Remove <common.h> and add needed includes 2024-05-06 15:05:04 -06:00
of_platdata.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
ofnode.c test: dm: Expand ofnode options test with new helper 2024-10-10 16:02:20 -06:00
ofread.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
osd.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
p2sb.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
panel.c power: regulator: Trigger probe of regulators which are always-on or boot-on 2024-09-30 19:19:07 -06:00
part.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
pch.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
pci.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
pci_ep.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
phy.c phy: test: Implement sandbox PHY .set_mode and DM test 2024-09-09 17:18:04 +02:00
phys2bus.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
pinmux.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
pmc.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
pmic.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
power-domain.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
pwm.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
qfw.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
ram.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
read.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
reboot-mode.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
regmap.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
regulator.c power: regulator: Trigger probe of regulators which are always-on or boot-on 2024-09-30 19:19:07 -06:00
remoteproc.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
reset.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
rkmtd.c test: Rename UTF_CONSOLE_REC to UTF_CONSOLE 2024-08-26 18:51:49 -06:00
rng.c test: dm: Use UTF_CONSOLE in tests 2024-08-26 18:51:49 -06:00
rtc.c test: dm: Use UTF_CONSOLE in tests 2024-08-26 18:51:49 -06:00
scmi.c test: dm: Use UTF_CONSOLE in tests 2024-08-26 18:51:49 -06:00
scsi.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
serial.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
sf.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
simple-bus.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
simple-pm-bus.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
sm.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
smem.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
soc.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
sound.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
spi.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
spmi.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
syscon-reset.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
syscon.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
sysinfo-gpio.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
sysinfo.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
sysreset.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
tag.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
tee.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
test-dm.c test: Remove <common.h> and add needed includes 2024-05-06 15:05:04 -06:00
test-driver.c test: Remove <common.h> and add needed includes 2024-05-06 15:05:04 -06:00
test-fdt.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
test-uclass.c test: Remove <common.h> and add needed includes 2024-05-06 15:05:04 -06:00
timer.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
tpm.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
usb.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
video.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
virtio.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
virtio_device.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
virtio_rng.c test: Rename unit-test flags 2024-08-26 18:51:48 -06:00
wdt.c test: dm: wdt: replace cyclic_run() by schedule() 2024-10-23 06:52:38 +02:00