u-boot/arch/x86
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
..
cpu Merge patch series "Implement ACPI on aarch64" 2024-10-27 18:44:13 -06:00
dts x86: coreboot: Enable support for the configuration editor 2024-11-03 21:27:12 -06:00
include/asm Merge patch series "Implement ACPI on aarch64" 2024-10-27 18:44:13 -06:00
lib dm: Add dm_remove_devices_active() for ordered device removal 2024-11-24 15:41:28 -06:00
config.mk arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD 2024-10-11 11:44:47 -06:00
Kconfig Merge patch series "Resolve issues with booting distros on x86" 2024-04-10 20:01:42 -06:00
Makefile global: Rename SPL_TPL_ to PHASE_ 2024-10-11 11:44:48 -06:00