From patchwork Fri Jul 2 06:27:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hiroshi DOYU X-Patchwork-Id: 109810 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o626SWCa006862 for ; Fri, 2 Jul 2010 06:28:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757323Ab0GBG1y (ORCPT ); Fri, 2 Jul 2010 02:27:54 -0400 Received: from smtp.nokia.com ([192.100.122.230]:62292 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757246Ab0GBG1v (ORCPT ); Fri, 2 Jul 2010 02:27:51 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o626RRWa030630; Fri, 2 Jul 2010 09:27:42 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 2 Jul 2010 09:27:38 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 2 Jul 2010 09:27:37 +0300 Received: from localhost (esdhcp04075.research.nokia.com [172.21.40.75]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o626RVeu019482; Fri, 2 Jul 2010 09:27:32 +0300 Date: Fri, 02 Jul 2010 09:27:31 +0300 (EEST) Message-Id: <20100702.092731.39168665.Hiroshi.DOYU@nokia.com> To: x0095840@ti.com Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, ohad@wizery.com, ameya.palande@nokia.com, felipe.contreras@nokia.com Subject: Re: [PATCH 5/9] dspbridge: add mmufault support From: Hiroshi DOYU In-Reply-To: <1277943660-4112-6-git-send-email-x0095840@ti.com> References: <1277943660-4112-4-git-send-email-x0095840@ti.com> <1277943660-4112-5-git-send-email-x0095840@ti.com> <1277943660-4112-6-git-send-email-x0095840@ti.com> X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 X-OriginalArrivalTime: 02 Jul 2010 06:27:38.0001 (UTC) FILETIME=[AA75D010:01CB19AF] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 02 Jul 2010 06:28:32 +0000 (UTC) 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); >