]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
of/fdt: Remove custom __early_init_dt_declare_initrd() implementation
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 5 Nov 2018 22:54:30 +0000 (14:54 -0800)
committerRob Herring <robh@kernel.org>
Mon, 26 Nov 2018 21:50:39 +0000 (15:50 -0600)
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>
arch/arm64/include/asm/memory.h
drivers/of/fdt.c

index b96442960aead1692e94d28dd35d33e7954d84b3..dc3ca21ba240b6bc930b19919f73af233e984ecb 100644 (file)
 #define IOREMAP_MAX_ORDER      (PMD_SHIFT)
 #endif
 
-#ifdef CONFIG_BLK_DEV_INITRD
-#define __early_init_dt_declare_initrd(__start, __end)                 \
-       do {                                                            \
-               initrd_start = (__start);                               \
-               initrd_end = (__end);                                   \
-       } while (0)
-#endif
-
 #ifndef __ASSEMBLY__
 
 #include <linux/bitops.h>
index 88760a0983a72a31ed63e63e6feca15a7c0a62a3..cd72a41fcab229cc76ac26889a560590e41b776c 100644 (file)
@@ -891,15 +891,20 @@ const void * __init of_flat_dt_match_machine(const void *default_match,
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
-#ifndef __early_init_dt_declare_initrd
 static void __early_init_dt_declare_initrd(unsigned long start,
                                           unsigned long end)
 {
-       initrd_start = (unsigned long)__va(start);
-       initrd_end = (unsigned long)__va(end);
-       initrd_below_start_ok = 1;
+       /* ARM64 would cause a BUG to occur here when CONFIG_DEBUG_VM is
+        * enabled since __va() is called too early. ARM64 does make use
+        * of phys_initrd_start/phys_initrd_size so we can skip this
+        * conversion.
+        */
+       if (!IS_ENABLED(CONFIG_ARM64)) {
+               initrd_start = (unsigned long)__va(start);
+               initrd_end = (unsigned long)__va(end);
+               initrd_below_start_ok = 1;
+       }
 }
-#endif
 
 /**
  * early_init_dt_check_for_initrd - Decode initrd location from flat tree