Skip to content

Commit b56f67a

Browse files
FlyGoatchenhuacai
authored andcommitted
LoongArch: Fix built-in DTB detection
fdt_check_header(__dtb_start) will always success because kernel provides a dummy dtb, and by coincidence __dtb_start clashed with entry of this dummy dtb. The consequence is fdt passed from firmware will never be taken. Fix by trying to utilise __dtb_start only when CONFIG_BUILTIN_DTB is enabled. Cc: [email protected] Fixes: 7b937cc ("of: Create of_root if no dtb provided by firmware") Signed-off-by: Jiaxun Yang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 6c3ca66 commit b56f67a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/loongarch/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static void __init fdt_setup(void)
282282
return;
283283

284284
/* Prefer to use built-in dtb, checking its legality first. */
285-
if (!fdt_check_header(__dtb_start))
285+
if (IS_ENABLED(CONFIG_BUILTIN_DTB) && !fdt_check_header(__dtb_start))
286286
fdt_pointer = __dtb_start;
287287
else
288288
fdt_pointer = efi_fdt_pointer(); /* Fallback to firmware dtb */

0 commit comments

Comments
 (0)