From patchwork Wed Aug 26 10:45:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hiroshi DOYU X-Patchwork-Id: 44014 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7QAlUYm018571 for ; Wed, 26 Aug 2009 10:47:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757066AbZHZKpr (ORCPT ); Wed, 26 Aug 2009 06:45:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757137AbZHZKpr (ORCPT ); Wed, 26 Aug 2009 06:45:47 -0400 Received: from smtp.nokia.com ([192.100.105.134]:60425 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757159AbZHZKpq (ORCPT ); Wed, 26 Aug 2009 06:45:46 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7QAiGBr004228 for ; Wed, 26 Aug 2009 05:45:17 -0500 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 26 Aug 2009 13:45:44 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 26 Aug 2009 13:45:44 +0300 Received: from localhost (esdhcp04130.research.nokia.com [172.21.41.30]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7QAjZEN029950 for ; Wed, 26 Aug 2009 13:45:36 +0300 Date: Wed, 26 Aug 2009 13:45:40 +0300 (EEST) Message-Id: <20090826.134540.189712717.Hiroshi.DOYU@nokia.com> To: "linux-omap@vger.kernel.org" Subject: [PATCH] omap iommu: avoid remapping if it's been mapped in MPU side From: Hiroshi DOYU References: <1251283037-19573-1-git-send-email-sakari.ailus@maxwell.research.nokia.com> In-Reply-To: <1251283037-19573-1-git-send-email-sakari.ailus@maxwell.research.nokia.com> Thread-Topic: [PATCH] omap iommu: avoid remapping if it's been mapped in MPU side Thread-Index: AcomOTRpPB5Zzv6gSIG+ai8/ToI3bw== Accept-Language: en-US X-Mailer: Mew version 5.2 on Emacs 22.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 X-OriginalArrivalTime: 26 Aug 2009 10:45:44.0405 (UTC) FILETIME=[5D050850:01CA263A] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index 6fc52fc..004fd83 100644 --- a/arch/arm/plat-omap/iovmm.c +++ b/arch/arm/plat-omap/iovmm.c @@ -615,7 +615,7 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt, u32 flags) { size_t bytes; - void *va; + void *va = NULL; if (!obj || !obj->dev || !sgt) return -EINVAL; @@ -625,9 +625,11 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt, return -EINVAL; bytes = PAGE_ALIGN(bytes); - va = vmap_sg(sgt); - if (IS_ERR(va)) - return PTR_ERR(va); + if (flags & IOVMF_MMIO) { + va = vmap_sg(sgt); + if (IS_ERR(va)) + return PTR_ERR(va); + } flags &= IOVMF_HW_MASK; flags |= IOVMF_DISCONT;