linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Will Schmidt <will_schmidt@vnet.ibm.com>
To: Olof Johansson <olof@lixom.net>, jk@ozlabs.org
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org
Subject: [PATCH] fix of_parse_dma_window.      was: Re: [PATCH 1/2] powerpc: Add of_parse_dma_window()
Date: Tue, 30 May 2006 13:38:40 -0500	[thread overview]
Message-ID: <1149014320.23168.11.camel@localhost.localdomain> (raw)
In-Reply-To: <20060518231306.GG8220@pb15.lixom.net>

On Thu, 2006-05-18 at 18:13 -0500, Olof Johansson wrote:
> On Fri, May 19, 2006 at 01:11:51AM +0200, Segher Boessenkool wrote:
> > > Acked-by: Olof Johansson <olof@lixom.net>
> > >
> > > (I'm assuming you've booted it on POWER4 LPAR and JS20, I don't
> > > have access to either to make sure it doesn't break there. Main worry
> > > would be if it lacked ibm,#dma*-properties for some reason.)
> > 
> > The code seems to be resilient against that.  Haven't tested though.
> 
> Well, yes. I should have said: if it lacks the ibm,#dma- and the
> normal addr-cells properties aren't the same as we assumed before.

My js20 appears to lack the ibm,#dma- properties, and boot fails with a
"Kernel panic - not syncing: iommu_init_table: Can't allocate 0 bytes"
message.  

This adds a fallback to the "#address-cells" property in case the
"#ibm,dma-address-cells" property is missing.   Tested on js20 and
power5 lpar.  

Unless there is a more elegant solution... :-)

Signed-off-by: Will Schmidt <willschm@us.ibm.com>


diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 23bb060..45df420 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -561,6 +561,9 @@ void of_parse_dma_window(struct device_n
 	*busno = *(dma_window++);
 
 	prop = get_property(dn, "ibm,#dma-address-cells", NULL);
+	if (!prop)
+		prop = get_property(dn, "#address-cells", NULL);
+
 	cells = prop ? *(u32 *)prop : prom_n_addr_cells(dn);
 	*phys = of_read_addr(dma_window, cells);
 

  parent reply	other threads:[~2006-05-30 18:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-18  6:20 [PATCH 1/2] powerpc: Add of_parse_dma_window() Jeremy Kerr
2006-05-18  6:28 ` Jeremy Kerr
2006-05-18 17:11 ` Olof Johansson
2006-05-18 23:11   ` Segher Boessenkool
2006-05-18 23:13     ` Olof Johansson
2006-05-18 23:55       ` Segher Boessenkool
2006-05-30 18:38       ` Will Schmidt [this message]
2006-05-31  4:17         ` [PATCH] fix of_parse_dma_window. was: " Jeremy Kerr
2006-05-30 18:55 ` Kumar Gala

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=1149014320.23168.11.camel@localhost.localdomain \
    --to=will_schmidt@vnet.ibm.com \
    --cc=jk@ozlabs.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=olof@lixom.net \
    --cc=paulus@samba.org \
    /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;
as well as URLs for NNTP newsgroup(s).