summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMichal Ostrowski <mostrows@watson.ibm.com>2005-12-02 05:09:13 +0300
committerPaul Mackerras <paulus@samba.org>2005-12-02 06:51:22 +0300
commitcc8b5c96a7ac7d695c2887427b1003bd33ec9c97 (patch)
treea8a745d54dae93438b6479cf807e07a51f8b210e /arch/powerpc
parentdeda498710e190c7922c2634ed630ee64ce86c05 (diff)
downloadlinux-cc8b5c96a7ac7d695c2887427b1003bd33ec9c97.tar.xz
[PATCH] powerpc/pseries: Fix TCE building with 64k pagesize
Must adjust tcenum and npages by TCE_PAGE_FACTOR to convert between 64KB pages and TCE (4K) pages. (This is done in other places, except for this one location.) Signed-off-by: Michal Ostrowski <mostrows at watson ibm com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index c78f2b290a73..fa1edbdcf88c 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -109,6 +109,9 @@ static void tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
u64 rc;
union tce_entry tce;
+ tcenum <<= TCE_PAGE_FACTOR;
+ npages <<= TCE_PAGE_FACTOR;
+
tce.te_word = 0;
tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
tce.te_rdwr = 1;
@@ -143,9 +146,6 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
union tce_entry tce, *tcep;
long l, limit;
- tcenum <<= TCE_PAGE_FACTOR;
- npages <<= TCE_PAGE_FACTOR;
-
if (npages == 1)
return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
direction);
@@ -164,6 +164,9 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
__get_cpu_var(tce_page) = tcep;
}
+ tcenum <<= TCE_PAGE_FACTOR;
+ npages <<= TCE_PAGE_FACTOR;
+
tce.te_word = 0;
tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
tce.te_rdwr = 1;