Skip to content

Commit

Permalink
[PATCH] powerpc: fix of_parse_dma_window
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Will Schmidt authored and Paul Mackerras committed Jun 9, 2006
1 parent c5cf0e3 commit 03ac829
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/powerpc/kernel/prom_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ void of_parse_dma_window(struct device_node *dn, unsigned char *dma_window_prop,
*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);

Expand Down

0 comments on commit 03ac829

Please sign in to comment.