From: Grant Likely <grant.likely@secretlab•ca>
To: devicetree-discuss@lists•ozlabs.org, benh@kernel•crashing.org,
monstr@monstr•eu, linuxppc-dev@lists•ozlabs.org
Subject: [v2 PATCH] of/flattree: Fix unhandled OF_DT_NOP tag when unflattening the device tree
Date: Fri, 19 Mar 2010 14:01:49 -0600 [thread overview]
Message-ID: <20100319200049.5195.97171.stgit@angua> (raw)
From: Jason Gunthorpe <jgunthorpe@obsidianresearch•com>
NOPs within the property section are skipped, but NOPs between
OF_DT_END_NODE and OF_DT_BEGIN_NODE were not. My firmware NOPs out
entire nodes depending on various environment parameters.
of_scan_flat_dt already handles NOP more generally.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch•com>
Signed-off-by: Grant Likely <grant.likely@secretlab•ca>
---
v2 - adapted to new location of unflatten_dt_node().
Jason, please test against 2.6.34-rc1
drivers/of/fdt.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 406757a..dee4fb5 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -376,8 +376,11 @@ unsigned long __init unflatten_dt_node(unsigned long mem,
if (!np->type)
np->type = "<NULL>";
}
- while (tag == OF_DT_BEGIN_NODE) {
- mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize);
+ while (tag == OF_DT_BEGIN_NODE || tag == OF_DT_NOP) {
+ if (tag == OF_DT_NOP)
+ *p += 4;
+ else
+ mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize);
tag = be32_to_cpup((__be32 *)(*p));
}
if (tag != OF_DT_END_NODE) {
next reply other threads:[~2010-03-19 20:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-19 20:01 Grant Likely [this message]
2010-03-20 0:24 ` [v2 PATCH] of/flattree: Fix unhandled OF_DT_NOP tag when unflattening the device tree David Gibson
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=20100319200049.5195.97171.stgit@angua \
--to=grant.likely@secretlab$(echo .)ca \
--cc=benh@kernel$(echo .)crashing.org \
--cc=devicetree-discuss@lists$(echo .)ozlabs.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=monstr@monstr$(echo .)eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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