aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Gorinov <ivan.gorinov@intel.com>2018-03-07 14:46:29 -0500
committerThomas Gleixner <tglx@linutronix.de>2018-03-08 03:59:53 -0500
commit628df9dc5ad886b0a9b33c75a7b09710eb859ca1 (patch)
treef1ea0bac6ce55474a3371fc0cc2773568a6cf5ee
parentac95090a0440be1b17aa1b5d9462d9c67146ce0b (diff)
x86/devicetree: Initialize device tree before using it
Commit 08d53aa58cb1 added CRC32 calculation in early_init_dt_verify() and checking in late initcall of_fdt_raw_init(), making early_init_dt_verify() mandatory. The required call to early_init_dt_verify() was not added to the x86-specific implementation, causing failure to create the sysfs entry in of_fdt_raw_init(). Fixes: 08d53aa58cb1 ("of/fdt: export fdt blob as /sys/firmware/fdt") Signed-off-by: Ivan Gorinov <ivan.gorinov@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Rob Herring <robh+dt@kernel.org> Link: https://lkml.kernel.org/r/c8c7e941efc63b5d25ebf9b6350b0f3df38f6098.1520450752.git.ivan.gorinov@intel.com
-rw-r--r--arch/x86/kernel/devicetree.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 25de5f6ca997..63d2ebc21825 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -11,6 +11,7 @@
11#include <linux/of_address.h> 11#include <linux/of_address.h>
12#include <linux/of_platform.h> 12#include <linux/of_platform.h>
13#include <linux/of_irq.h> 13#include <linux/of_irq.h>
14#include <linux/libfdt.h>
14#include <linux/slab.h> 15#include <linux/slab.h>
15#include <linux/pci.h> 16#include <linux/pci.h>
16#include <linux/of_pci.h> 17#include <linux/of_pci.h>
@@ -270,14 +271,15 @@ static void __init x86_flattree_get_config(void)
270 271
271 map_len = max(PAGE_SIZE - (initial_dtb & ~PAGE_MASK), (u64)128); 272 map_len = max(PAGE_SIZE - (initial_dtb & ~PAGE_MASK), (u64)128);
272 273
273 initial_boot_params = dt = early_memremap(initial_dtb, map_len); 274 dt = early_memremap(initial_dtb, map_len);
274 size = of_get_flat_dt_size(); 275 size = fdt_totalsize(dt);
275 if (map_len < size) { 276 if (map_len < size) {
276 early_memunmap(dt, map_len); 277 early_memunmap(dt, map_len);
277 initial_boot_params = dt = early_memremap(initial_dtb, size); 278 dt = early_memremap(initial_dtb, size);
278 map_len = size; 279 map_len = size;
279 } 280 }
280 281
282 early_init_dt_verify(dt);
281 unflatten_and_copy_device_tree(); 283 unflatten_and_copy_device_tree();
282 early_memunmap(dt, map_len); 284 early_memunmap(dt, map_len);
283} 285}