powerpc/cell: Fix cell iommu after it_page_shift changes
authorMichael Ellerman <mpe@ellerman.id.au>
Fri, 3 Apr 2015 03:11:54 +0000 (14:11 +1100)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:12:14 +0000 (19:12 -0400)
[ Upstream commit 7261b956b276aa97fbf60d00f1d7717d2ea6ee78 ]

The patch to add it_page_shift incorrectly changed the increment of
uaddr to use it_page_shift, rather then (1 << it_page_shift).

This broke booting on at least some Cell blades, as the iommu was
basically non-functional.

Fixes: 3a553170d35d ("powerpc/iommu: Add it_page_shift field to determine iommu page size")
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/powerpc/platforms/cell/iommu.c

index 2b90ff8a93bea7542fee7d89f99d3439bf9e0d13..59ef76c5f4f4a4eb5340323a17435bfde19bfc38 100644 (file)
@@ -197,7 +197,7 @@ static int tce_build_cell(struct iommu_table *tbl, long index, long npages,
 
        io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset);
 
-       for (i = 0; i < npages; i++, uaddr += tbl->it_page_shift)
+       for (i = 0; i < npages; i++, uaddr += (1 << tbl->it_page_shift))
                io_pte[i] = base_pte | (__pa(uaddr) & CBE_IOPTE_RPN_Mask);
 
        mb();