From: Ivan Gorinov <ivan.gorinov@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>, Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Subject: [PATCH v4 1/4] x86/devicetree: Initialize device tree before using it
Date: Wed, 7 Mar 2018 11:46:29 -0800 [thread overview]
Message-ID: <c8c7e941efc63b5d25ebf9b6350b0f3df38f6098.1520450752.git.ivan.gorinov@intel.com> (raw)
In-Reply-To: <cover.1520450752.git.ivan.gorinov@intel.com>
Commit 08d53aa58cb162e6 ("of/fdt: export fdt blob as /sys/firmware/fdt")
adds CRC32 calculation in early_init_dt_verify() and checking in late
initcall of_fdt_raw_init(), making early_init_dt_verify() mandatory.
Required call to early_init_dt_verify() was not added to the x86-specific
implementation, causing failure to create sysfs entry in of_fdt_raw_init().
Signed-off-by: Ivan Gorinov <ivan.gorinov@intel.com>
---
arch/x86/kernel/devicetree.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 25de5f6..63d2ebc 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -11,6 +11,7 @@
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/of_irq.h>
+#include <linux/libfdt.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/of_pci.h>
@@ -270,14 +271,15 @@ static void __init x86_flattree_get_config(void)
map_len = max(PAGE_SIZE - (initial_dtb & ~PAGE_MASK), (u64)128);
- initial_boot_params = dt = early_memremap(initial_dtb, map_len);
- size = of_get_flat_dt_size();
+ dt = early_memremap(initial_dtb, map_len);
+ size = fdt_totalsize(dt);
if (map_len < size) {
early_memunmap(dt, map_len);
- initial_boot_params = dt = early_memremap(initial_dtb, size);
+ dt = early_memremap(initial_dtb, size);
map_len = size;
}
+ early_init_dt_verify(dt);
unflatten_and_copy_device_tree();
early_memunmap(dt, map_len);
}
--
2.7.4
next prev parent reply other threads:[~2018-03-07 19:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 19:45 [PATCH v4 0/4] x86/devicetree: Re-enable x86-specific implementation Ivan Gorinov
2018-03-07 19:46 ` Ivan Gorinov [this message]
2018-03-08 9:03 ` [tip:x86/platform] x86/devicetree: Initialize device tree before using it tip-bot for Ivan Gorinov
2018-03-07 19:46 ` [PATCH v4 2/4] x86/devicetree: Fix device IRQ settings in DT Ivan Gorinov
2018-03-08 9:04 ` [tip:x86/platform] " tip-bot for Ivan Gorinov
2018-03-07 19:47 ` [PATCH v4 3/4] of: Documentation: Add x86 local APIC ID property Ivan Gorinov
2018-03-07 20:23 ` Rob Herring
2018-03-08 1:11 ` Ivan Gorinov
2018-03-08 1:34 ` Rob Herring
2018-03-07 19:47 ` [PATCH v4 4/4] x86/devicetree: Enable multiprocessing in DT Ivan Gorinov
2018-03-08 2:16 ` [PATCH v4 0/4] x86/devicetree: Re-enable x86-specific implementation Frank Rowand
2018-03-13 16:08 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c8c7e941efc63b5d25ebf9b6350b0f3df38f6098.1520450752.git.ivan.gorinov@intel.com \
--to=ivan.gorinov@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=robh+dt@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®