diff mbox series

[2/2] efi/fdt: ignore dtb when acpi option is used with force

Message ID 20241125145848.506347-3-yeoreum.yun@arm.com
State New
Headers show
Series small fixes when boot with acpi=force option | expand

Commit Message

Yeoreum Yun Nov. 25, 2024, 2:58 p.m. UTC
Since acpi=force doesn't use dt fallback, it's meaningless to load dt
from comaand line option or from configuration table.
Skip loading dt when acpi=force option is used.
otherwise it could produce unnecessary error message
while scanning dt if passed dt's format is invalid.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
---
 drivers/firmware/efi/libstub/fdt.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c
index 6a337f1f8787..04a054393d87 100644
--- a/drivers/firmware/efi/libstub/fdt.c
+++ b/drivers/firmware/efi/libstub/fdt.c
@@ -251,11 +251,13 @@  efi_status_t allocate_new_fdt_and_exit_boot(void *handle,
 		if (strstr(cmdline_ptr, "dtb="))
 			efi_err("Ignoring DTB from command line.\n");
 	} else {
-		status = efi_load_dtb(image, &fdt_addr, &fdt_size);
+		if (!strstr(cmdline_ptr, "acpi=force")) {
+			status = efi_load_dtb(image, &fdt_addr, &fdt_size);
 
-		if (status != EFI_SUCCESS && status != EFI_NOT_READY) {
-			efi_err("Failed to load device tree!\n");
-			goto fail;
+			if (status != EFI_SUCCESS && status != EFI_NOT_READY) {
+				efi_err("Failed to load device tree!\n");
+				goto fail;
+			}
 		}
 	}