[PATCH] PPC64 VIO iommu table property parsing wrong

Olof Johansson olof at austin.ibm.com
Thu Nov 4 04:17:30 EST 2004


Andrew, please apply:

With current firmware, the ibm,my-dma-window property now contains
two panes for VSCSI server nodes. This breaks the current tests in the
setup code.

There's a bunch of references to pre-GA firmware bugs. That's a while ago,
so we can remove the workarounds without breaking anyone.

Signed-off-by: Olof Johansson <olof at austin.ibm.com>


---

 linux-2.5-olof/arch/ppc64/kernel/vio.c |   19 +------------------
 1 files changed, 1 insertion(+), 18 deletions(-)

diff -puN arch/ppc64/kernel/vio.c~vio-iommu arch/ppc64/kernel/vio.c
--- linux-2.5/arch/ppc64/kernel/vio.c~vio-iommu	2004-11-03 09:50:29.829990236 -0600
+++ linux-2.5-olof/arch/ppc64/kernel/vio.c	2004-11-03 10:12:07.313786376 -0600
@@ -521,24 +521,7 @@ static struct iommu_table * vio_build_io
 
 	newTceTable = (struct iommu_table *) kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
 
-	/* RPA docs say that #address-cells is always 1 for virtual
-		devices, but some older boxes' OF returns 2.  This should
-		be removed by GA, unless there is legacy OFs that still
-		have 2 for #address-cells */
-	size = ((dma_window[1+vio_num_address_cells] >> PAGE_SHIFT) << 3)
-		>> PAGE_SHIFT;
-
-	/* This is just an ugly kludge. Remove as soon as the OF for all
-	machines actually follow the spec and encodes the offset field
-	as phys-encode (that is, #address-cells wide)*/
-	if (dma_window_property_size == 12) {
-		size = ((dma_window[1] >> PAGE_SHIFT) << 3) >> PAGE_SHIFT;
-	} else if (dma_window_property_size == 20) {
-		size = ((dma_window[4] >> PAGE_SHIFT) << 3) >> PAGE_SHIFT;
-	} else {
-		printk(KERN_WARNING "vio_build_iommu_table: Invalid size of ibm,my-dma-window=%i, using 0x80 for size\n", dma_window_property_size);
-		size = 0x80;
-	}
+	size = ((dma_window[4] >> PAGE_SHIFT) << 3) >> PAGE_SHIFT;
 
 	/*  There should be some code to extract the phys-encoded offset
 		using prom_n_addr_cells(). However, according to a comment

_



More information about the Linuxppc64-dev mailing list