[PATCH] initialize TCE tables

John Rose johnrose at austin.ibm.com
Thu Jun 2 04:10:36 EST 2005


A fairly recent platform requirement states that the OS must clear the
whole TCE table at setup time, in case firmware left any active
mappings in it.  Without this initialization, dynamic bus removes can
fail.  Firmware rejects these requests if active mappings still exist 
for a slot that has been deallocated by the OS.

If there are no objections, I'll forward this to Andrew Morton.

Thanks-
John

Signed-off-by: Olof Johansson <olof at austin.ibm.com>
Signed-off-by: John Rose <johnrose at austin.ibm.com>

diff -puN arch/ppc64/kernel/iommu.c~initialize_tces arch/ppc64/kernel/iommu.c
--- 2_6_linus_2/arch/ppc64/kernel/iommu.c~initialize_tces	2005-06-01 12:17:53.000000000 -0500
+++ 2_6_linus_2-johnrose/arch/ppc64/kernel/iommu.c	2005-06-01 12:19:56.000000000 -0500
@@ -423,6 +423,9 @@ struct iommu_table *iommu_init_table(str
 	tbl->it_largehint = tbl->it_halfpoint;
 	spin_lock_init(&tbl->it_lock);
 
+	/* Clear the hardware table in case firmware left allocations in it */
+	ppc_md.tce_free(tbl, 0, tbl->it_size);
+
 	if (!welcomed) {
 		printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
 		       novmerge ? "disabled" : "enabled");

_




More information about the Linuxppc64-dev mailing list