* [PATCH] PPC: Skip over OF_DT_NOP when unflattening the device tree
@ 2010-03-09 19:30 Jason Gunthorpe
2010-03-19 5:50 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2010-03-09 19:30 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-kernel
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>
---
arch/powerpc/kernel/prom.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 4ec3008..92137b2 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -408,8 +408,11 @@ static 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 = *((u32 *)(*p));
}
if (tag != OF_DT_END_NODE) {
--
1.5.4.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] PPC: Skip over OF_DT_NOP when unflattening the device tree
2010-03-09 19:30 [PATCH] PPC: Skip over OF_DT_NOP when unflattening the device tree Jason Gunthorpe
@ 2010-03-19 5:50 ` Benjamin Herrenschmidt
2010-03-19 6:06 ` Jason Gunthorpe
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2010-03-19 5:50 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linuxppc-dev, linux-kernel, Grant Likely
On Tue, 2010-03-09 at 12:30 -0700, Jason Gunthorpe wrote:
> 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..
Good catch, though that code has now moved over to drivers/of
and is a bit different. Grant is going to fix it up though.
Cheers,
Ben.
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
> arch/powerpc/kernel/prom.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 4ec3008..92137b2 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -408,8 +408,11 @@ static 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 = *((u32 *)(*p));
> }
> if (tag != OF_DT_END_NODE) {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PPC: Skip over OF_DT_NOP when unflattening the device tree
2010-03-19 5:50 ` Benjamin Herrenschmidt
@ 2010-03-19 6:06 ` Jason Gunthorpe
2010-03-19 6:18 ` Grant Likely
0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2010-03-19 6:06 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-kernel, Grant Likely
On Fri, Mar 19, 2010 at 04:50:38PM +1100, Benjamin Herrenschmidt wrote:
> On Tue, 2010-03-09 at 12:30 -0700, Jason Gunthorpe wrote:
> > 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..
>
> Good catch, though that code has now moved over to drivers/of
> and is a bit different. Grant is going to fix it up though.
Ah, I based the patch off 2.6.33..
Grant: let me know if you need some help/testing, nice to run into you
again.
Jason
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PPC: Skip over OF_DT_NOP when unflattening the device tree
2010-03-19 6:06 ` Jason Gunthorpe
@ 2010-03-19 6:18 ` Grant Likely
0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2010-03-19 6:18 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: Benjamin Herrenschmidt, linuxppc-dev, linux-kernel
On Fri, Mar 19, 2010 at 12:06 AM, Jason Gunthorpe
<jgunthorpe@obsidianresearch.com> wrote:
> On Fri, Mar 19, 2010 at 04:50:38PM +1100, Benjamin Herrenschmidt wrote:
>> On Tue, 2010-03-09 at 12:30 -0700, Jason Gunthorpe wrote:
>> > 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..
>>
>> Good catch, though that code has now moved over to drivers/of
>> and is a bit different. Grant is going to fix it up though.
>
> Ah, I based the patch off 2.6.33..
>
> Grant: let me know if you need some help/testing, nice to run into you
> again.
Would be nice if you could respin and test your patch against 2.6.34-rc1. :-)
Otherwise I'll look at it tomorrow.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-19 6:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-09 19:30 [PATCH] PPC: Skip over OF_DT_NOP when unflattening the device tree Jason Gunthorpe
2010-03-19 5:50 ` Benjamin Herrenschmidt
2010-03-19 6:06 ` Jason Gunthorpe
2010-03-19 6:18 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).