From patchwork Fri Mar 4 14:39:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jones X-Patchwork-Id: 609201 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p24Ed9Sw032303 for ; Fri, 4 Mar 2011 14:39:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759671Ab1CDOjF (ORCPT ); Fri, 4 Mar 2011 09:39:05 -0500 Received: from mail1.matrix-vision.com ([78.47.19.71]:55857 "EHLO mail1.matrix-vision.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759459Ab1CDOjE (ORCPT ); Fri, 4 Mar 2011 09:39:04 -0500 Received: from mail1.matrix-vision.com (localhost [127.0.0.1]) by mail1.matrix-vision.com (Postfix) with ESMTP id 2507D722BC; Fri, 4 Mar 2011 15:39:02 +0100 (CET) Received: from erinome (g2.matrix-vision.com [80.152.136.245]) by mail1.matrix-vision.com (Postfix) with ESMTPA id CE08E721AD; Fri, 4 Mar 2011 15:39:01 +0100 (CET) Received: from erinome (localhost [127.0.0.1]) by erinome (Postfix) with ESMTP id 4EE486F8A; Fri, 4 Mar 2011 15:39:01 +0100 (CET) Received: by erinome (Postfix, from userid 108) id 442306F9C; Fri, 4 Mar 2011 15:39:01 +0100 (CET) Received: from [192.168.65.46] (host65-46.intern.matrix-vision.de [192.168.65.46]) by erinome (Postfix) with ESMTPA id 322936F8A; Fri, 4 Mar 2011 15:39:01 +0100 (CET) Message-ID: <4D70F985.8030902@matrix-vision.de> Date: Fri, 04 Mar 2011 15:39:01 +0100 From: Michael Jones User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: David Cohen CC: Laurent Pinchart , fernando.lugo@ti.com, Sakari Ailus , Linux Media Mailing List , linux-omap@vger.kernel.org, Hiroshi.DOYU@nokia.com Subject: Re: omap3isp cache error when unloading References: <4D6D219D.7020605@matrix-vision.de> <201103022018.23446.laurent.pinchart@ideasonboard.com> <4D6FBC7F.1080500@matrix-vision.de> In-Reply-To: X-MV-Disclaimer: true (erinome) X-AV-Checked: ClamAV using ClamSMTP (erinome) X-AV-Checked: ClamAV using ClamSMTP (mail1) 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.6 (demeter1.kernel.org [140.211.167.41]); Fri, 04 Mar 2011 14:39:09 +0000 (UTC) diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index 6dc1296..11c9b76 100644 --- a/arch/arm/plat-omap/iovmm.c +++ b/arch/arm/plat-omap/iovmm.c @@ -271,20 +271,24 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da, size_t bytes, u32 flags) { struct iovm_struct *new, *tmp; - u32 start, prev_end, alignement; + u32 start, prev_end, alignment; if (!obj || !bytes) return ERR_PTR(-EINVAL); start = da; - alignement = PAGE_SIZE; + alignment = PAGE_SIZE; if (flags & IOVMF_DA_ANON) { - start = obj->da_start; + /* Don't map address 0 */ + if (obj->da_start) + start = obj->da_start; + else + start = obj->da_start + alignment; if (flags & IOVMF_LINEAR) - alignement = iopgsz_max(bytes); - start = roundup(start, alignement); + alignment = iopgsz_max(bytes); + start = roundup(start, alignment); } else if (start < obj->da_start || start > obj->da_end || obj->da_end - start < bytes) { return ERR_PTR(-EINVAL); @@ -304,7 +308,7 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da, goto found; if (tmp->da_end >= start && flags & IOVMF_DA_ANON) - start = roundup(tmp->da_end + 1, alignement); + start = roundup(tmp->da_end + 1, alignment); prev_end = tmp->da_end; }