[PATCH] [PPC64] Fix iommu cleanup regression

Olof Johansson olof at austin.ibm.com
Sat Jan 8 07:00:26 EST 2005


Hi,

In the recent IOMMU cleanup, the new LPAR code assumes that all PHBs
must have a dma window assigned to it. On some machines we don't have
a window assinged unless there's an adapter in the slot.

In other words, a PHB without a ibm,dma-window property is not a bug and
must be tolerated. This patch fixes that, and also removes a redundant
check for the dma-window being defined.

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


---

 linux-2.5-olof/arch/ppc64/kernel/pSeries_iommu.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff -puN arch/ppc64/kernel/pSeries_iommu.c~iommu-cleanup-bugfix arch/ppc64/kernel/pSeries_iommu.c
--- linux-2.5/arch/ppc64/kernel/pSeries_iommu.c~iommu-cleanup-bugfix	2005-01-07 12:52:18.960683160 -0600
+++ linux-2.5-olof/arch/ppc64/kernel/pSeries_iommu.c	2005-01-07 13:44:19.427300128 -0600
@@ -293,10 +293,6 @@ static void iommu_table_setparms_lpar(st
 				      struct iommu_table *tbl,
 				      unsigned int *dma_window)
 {
-	if (!dma_window)
-		panic("iommu_table_setparms_lpar: device %s has no"
-		      " ibm,dma-window property!\n", dn->full_name);
-
 	tbl->it_busno  = dn->bussubno;
 
 	/* TODO: Parse field size properties properly. */
@@ -385,7 +381,10 @@ static void iommu_bus_setup_pSeriesLP(st
 			break;
 	}
 
-	WARN_ON(dma_window == NULL);
+	if (dma_window == NULL) {
+		DBG("iommu_bus_setup_pSeriesLP: bus %s seems to have no ibm,dma-window property\n", dn->full_name);
+		return;
+	}
 
 	if (!pdn->iommu_table) {
 		/* Bussubno hasn't been copied yet.
@@ -420,10 +419,11 @@ static void iommu_dev_setup_pSeries(stru
 	while (dn && dn->iommu_table == NULL)
 		dn = dn->parent;
 
-	WARN_ON(!dn);
-
-	if (dn)
+	if (dn) {
 		mydn->iommu_table = dn->iommu_table;
+	} else {
+		DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, dev->pretty_name);
+	}
 }
 
 static void iommu_bus_setup_null(struct pci_bus *b) { }

_



More information about the Linuxppc64-dev mailing list