diff options
| author | Florian Fainelli <f.fainelli@gmail.com> | 2018-11-05 17:54:30 -0500 |
|---|---|---|
| committer | Rob Herring <robh@kernel.org> | 2018-11-26 16:50:39 -0500 |
| commit | cdbc848b03414c75b7badccd8ada29deba7ec6e4 (patch) | |
| tree | 651176bc2b4a59a7efa042bb6a6db8aad7b7123c | |
| parent | c756c592e442ba101c91daed3524ba5b3a784ba6 (diff) | |
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>
| -rw-r--r-- | arch/arm64/include/asm/memory.h | 8 | ||||
| -rw-r--r-- | drivers/of/fdt.c | 15 |
2 files changed, 10 insertions, 13 deletions
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index b96442960aea..dc3ca21ba240 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h | |||
| @@ -168,14 +168,6 @@ | |||
| 168 | #define IOREMAP_MAX_ORDER (PMD_SHIFT) | 168 | #define IOREMAP_MAX_ORDER (PMD_SHIFT) |
| 169 | #endif | 169 | #endif |
| 170 | 170 | ||
| 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 | |||
| 179 | #ifndef __ASSEMBLY__ | 171 | #ifndef __ASSEMBLY__ |
| 180 | 172 | ||
| 181 | #include <linux/bitops.h> | 173 | #include <linux/bitops.h> |
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 88760a0983a7..cd72a41fcab2 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
| @@ -891,15 +891,20 @@ const void * __init of_flat_dt_match_machine(const void *default_match, | |||
| 891 | } | 891 | } |
| 892 | 892 | ||
| 893 | #ifdef CONFIG_BLK_DEV_INITRD | 893 | #ifdef CONFIG_BLK_DEV_INITRD |
| 894 | #ifndef __early_init_dt_declare_initrd | ||
| 895 | static void __early_init_dt_declare_initrd(unsigned long start, | 894 | static void __early_init_dt_declare_initrd(unsigned long start, |
| 896 | unsigned long end) | 895 | unsigned long end) |
| 897 | { | 896 | { |
| 898 | initrd_start = (unsigned long)__va(start); | 897 | /* ARM64 would cause a BUG to occur here when CONFIG_DEBUG_VM is |
| 899 | initrd_end = (unsigned long)__va(end); | 898 | * enabled since __va() is called too early. ARM64 does make use |
| 900 | initrd_below_start_ok = 1; | 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 | } | ||
| 901 | } | 907 | } |
| 902 | #endif | ||
| 903 | 908 | ||
| 904 | /** | 909 | /** |
| 905 | * early_init_dt_check_for_initrd - Decode initrd location from flat tree | 910 | * early_init_dt_check_for_initrd - Decode initrd location from flat tree |
