diff mbox

[5/9] dspbridge: add mmufault support

Message ID 20100702.092731.39168665.Hiroshi.DOYU@nokia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hiroshi DOYU July 2, 2010, 6:27 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index a202a2c..17407f1 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -800,7 +800,7 @@  static irqreturn_t iommu_fault_handler(int irq, void *data)
 	if (!stat)
 		return IRQ_HANDLED;
 
-	iommu_disable(obj);
+	iommu_disable(obj);	<- HERE!
 
 	iopgd = iopgd_offset(obj, da);

You can find the latest omap iommu code from:
git://gitorious.org/~doyu/lk/mainline.git v2.6.35-rc3-iommu-for-next

Also I just thought that, passing 'da' to user callback might be
cleaner as below. Then you can avoid the direct access to IOMMU
registers. Basically we should avoid the direct access to IOMMU
registers from client. If you have to, then it would be better to
modify omap iommu code itself.

	Modified arch/arm/plat-omap/iommu.c
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index a202a2c..64d918e 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -787,13 +787,6 @@  static irqreturn_t iommu_fault_handler(int irq, void *data)
 	if (!obj->refcount)
 		return IRQ_NONE;
 
-	/* Dynamic loading TLB or PTE */
-	if (obj->isr)
-		err = obj->isr(obj);
-
-	if (!err)
-		return IRQ_HANDLED;
-
 	clk_enable(obj->clk);
 	stat = iommu_report_fault(obj, &da);
 	clk_disable(obj->clk);
@@ -802,6 +795,13 @@  static irqreturn_t iommu_fault_handler(int irq, void *data)
 
 	iommu_disable(obj);
 
+	/* user registered callback */
+	if (obj->isr)
+		err = obj->isr(obj, da);
+
+	if (!err)
+		return IRQ_HANDLED;
+
 	iopgd = iopgd_offset(obj, da);

>