Skip to content

Commit

Permalink
[PATCH] powerpc/pseries: Fix TCE building with 64k pagesize
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michal Ostrowski authored and Paul Mackerras committed Dec 2, 2005
1 parent deda498 commit cc8b5c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions arch/powerpc/platforms/pseries/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit cc8b5c9

Please sign in to comment.