please pull powerpc-merge.git

Olof Johansson olof at lixom.net
Fri Dec 2 16:09:03 EST 2005


On Fri, Dec 02, 2005 at 03:57:05PM +1100, Paul Mackerras wrote:

> Michal Ostrowski:
>       powerpc/pseries: Fix TCE building with 64k pagesize

Did I miss this one when it went by on the list, or was it never posted
there?

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.


Thanks,

Olof

----


Fix adjustment of TCE_PAGE_FACTOR in fallbacks to tce_build_pSeriesLP.


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:06:36.000000000 -0600
@@ -147,7 +147,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 +160,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