Skip to content

Commit cdbc848

Browse files
ffainellirobherring
authored andcommitted
of/fdt: Remove custom __early_init_dt_declare_initrd() implementation
Now that ARM64 uses phys_initrd_start/phys_initrd_size, we can get rid of its custom __early_init_dt_declare_initrd() which causes a fair amount of objects rebuild when changing CONFIG_BLK_DEV_INITRD. In order to make sure ARM64 does not produce a BUG() when VM debugging is turned on though, we must avoid early calls to __va() which is what __early_init_dt_declare_initrd() does and wrap this around to avoid running that code on ARM64. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Rob Herring <robh@kernel.org>
1 parent c756c59 commit cdbc848

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

arch/arm64/include/asm/memory.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,6 @@
168168
#define IOREMAP_MAX_ORDER (PMD_SHIFT)
169169
#endif
170170

171-
#ifdef CONFIG_BLK_DEV_INITRD
172-
#define __early_init_dt_declare_initrd(__start, __end) \
173-
do { \
174-
initrd_start = (__start); \
175-
initrd_end = (__end); \
176-
} while (0)
177-
#endif
178-
179171
#ifndef __ASSEMBLY__
180172

181173
#include <linux/bitops.h>

drivers/of/fdt.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -891,15 +891,20 @@ const void * __init of_flat_dt_match_machine(const void *default_match,
891891
}
892892

893893
#ifdef CONFIG_BLK_DEV_INITRD
894-
#ifndef __early_init_dt_declare_initrd
895894
static void __early_init_dt_declare_initrd(unsigned long start,
896895
unsigned long end)
897896
{
898-
initrd_start = (unsigned long)__va(start);
899-
initrd_end = (unsigned long)__va(end);
900-
initrd_below_start_ok = 1;
897+
/* ARM64 would cause a BUG to occur here when CONFIG_DEBUG_VM is
898+
* enabled since __va() is called too early. ARM64 does make use
899+
* of phys_initrd_start/phys_initrd_size so we can skip this
900+
* conversion.
901+
*/
902+
if (!IS_ENABLED(CONFIG_ARM64)) {
903+
initrd_start = (unsigned long)__va(start);
904+
initrd_end = (unsigned long)__va(end);
905+
initrd_below_start_ok = 1;
906+
}
901907
}
902-
#endif
903908

904909
/**
905910
* early_init_dt_check_for_initrd - Decode initrd location from flat tree

0 commit comments

Comments
 (0)