please pull powerpc-merge.git

Olof Johansson olof at lixom.net
Fri Dec 2 16:13:55 EST 2005


On Thu, Dec 01, 2005 at 11:09:03PM -0600, olof wrote:

> That's not a good way to do it -- tce_build_pSeriesLP will be called
> for 1 64K page, but it will actually insert 16 4K pages. It's definately
> a case for buildmulti.
> 
> I suggest the following instead.

..and I forgot to include the first fix of regular build_pSeriesLP. Crap.

New patch:


---


Fix adjustment of TCE_PAGE_FACTOR in tce_build_pSeriesLP and fallbacks
to it.


Signed-off-by: Olof Johansson <olof at lixom.net>

Index: 2.6/arch/powerpc/platforms/pseries/iommu.c
===================================================================
--- 2.6.orig/arch/powerpc/platforms/pseries/iommu.c	2005-11-29 09:11:47.000000000 -0600
+++ 2.6/arch/powerpc/platforms/pseries/iommu.c	2005-12-01 23:12:57.000000000 -0600
@@ -109,6 +109,9 @@ static void tce_build_pSeriesLP(struct i
 	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;
@@ -147,7 +150,8 @@ static void tce_buildmulti_pSeriesLP(str
 	npages <<= TCE_PAGE_FACTOR;
 
 	if (npages == 1)
-		return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
+		return tce_build_pSeriesLP(tbl, tcenum >> TCE_PAGE_FACTOR,
+			       		   npages >>TCE_PAGE_FACTOR, uaddr,
 					   direction);
 
 	tcep = __get_cpu_var(tce_page);
@@ -159,7 +163,8 @@ static void tce_buildmulti_pSeriesLP(str
 		tcep = (void *)__get_free_page(GFP_ATOMIC);
 		/* If allocation fails, fall back to the loop implementation */
 		if (!tcep)
-			return tce_build_pSeriesLP(tbl, tcenum, npages,
+			return tce_build_pSeriesLP(tbl, tcenum >> TCE_PAGE_FACTOR,
+						   npages >> TCE_PAGE_FACTOR,
 						   uaddr, direction);
 		__get_cpu_var(tce_page) = tcep;
 	}



More information about the Linuxppc64-dev mailing list