From patchwork Tue Mar 9 19:30:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 47185 X-Patchwork-Delegate: grant.likely@secretlab.ca Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 15AF2100A72 for ; Wed, 10 Mar 2010 09:28:30 +1100 (EST) Received: by ozlabs.org (Postfix) id F06AEB7D1B; Wed, 10 Mar 2010 07:12:05 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from quartz.orcorp.ca (quartz.orcorp.ca [139.142.54.143]) by ozlabs.org (Postfix) with ESMTP id B5F9BB7D19 for ; Wed, 10 Mar 2010 07:12:05 +1100 (EST) Received: from [10.0.0.11] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.68) (envelope-from ) id 1Np58H-0006KA-FJ; Tue, 09 Mar 2010 12:30:21 -0700 Received: from jgg by jggl.edm.orcorp.ca with local (Exim 4.69) (envelope-from ) id 1Np58H-00089q-DN; Tue, 09 Mar 2010 12:30:21 -0700 Date: Tue, 9 Mar 2010 12:30:21 -0700 From: Jason Gunthorpe To: linuxppc-dev@ozlabs.org Subject: [PATCH] PPC: Skip over OF_DT_NOP when unflattening the device tree Message-ID: <20100309193021.GD30462@obsidianresearch.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.11 X-Mailman-Approved-At: Wed, 10 Mar 2010 09:27:24 +1100 Cc: linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org 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 --- 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 = ""; } - 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) {