]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] initialize TCE tables
authorJohn Rose <johnrose@austin.ibm.com>
Mon, 20 Jun 2005 11:43:48 +0000 (21:43 +1000)
committerPaul Mackerras <paulus@samba.org>
Mon, 20 Jun 2005 11:43:48 +0000 (21:43 +1000)
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.

Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc64/kernel/iommu.c

index 344164681d2ce5a4f4373ed9637140e42d17fcee..8316426ccaf60036c59d3cd45e18835d8e19c88a 100644 (file)
@@ -423,6 +423,9 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl)
        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, tbl->it_offset, tbl->it_size);
+
        if (!welcomed) {
                printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
                       novmerge ? "disabled" : "enabled");