From patchwork Tue Mar 1 19:46:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guzman Lugo, Fernando" X-Patchwork-Id: 600821 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 p21JlUDt010748 for ; Tue, 1 Mar 2011 19:47:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757242Ab1CATq5 (ORCPT ); Tue, 1 Mar 2011 14:46:57 -0500 Received: from na3sys009aog104.obsmtp.com ([74.125.149.73]:56090 "EHLO na3sys009aog104.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757236Ab1CATqz (ORCPT ); Tue, 1 Mar 2011 14:46:55 -0500 Received: from source ([209.85.160.173]) (using TLSv1) by na3sys009aob104.postini.com ([74.125.148.12]) with SMTP ID DSNKTW1NLhiw8Cky0ZGhWAt4VwKa96j6JOq0@postini.com; Tue, 01 Mar 2011 11:46:55 PST Received: by mail-gy0-f173.google.com with SMTP id 8so2742365gyd.18 for ; Tue, 01 Mar 2011 11:46:54 -0800 (PST) Received: by 10.150.145.16 with SMTP id s16mr9638806ybd.101.1299008814177; Tue, 01 Mar 2011 11:46:54 -0800 (PST) Received: from localhost.localdomain (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id 68sm3194839yhl.19.2011.03.01.11.46.53 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Mar 2011 11:46:53 -0800 (PST) From: Fernando Guzman Lugo To: Cc: , , linux-omap@vger.kernel.org, , , Hari Kanigeri Subject: [PATCH] OMAP:iommu - pgd and pte entries weren't getting flushed out Date: Tue, 1 Mar 2011 13:46:33 -0600 Message-Id: <1299008793-27428-2-git-send-email-fernando.lugo@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1299008793-27428-1-git-send-email-fernando.lugo@ti.com> References: <1299008793-27428-1-git-send-email-fernando.lugo@ti.com> 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]); Tue, 01 Mar 2011 19:47:30 +0000 (UTC) diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index aeb2c33..e9473ff 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c @@ -508,7 +508,7 @@ static u32 *iopte_alloc(struct iommu *obj, u32 *iopgd, u32 da) return ERR_PTR(-ENOMEM); *iopgd = virt_to_phys(iopte) | IOPGD_TABLE; - flush_iopgd_range(iopgd, iopgd); + flush_iopgd_range(iopgd, iopgd + 1); dev_vdbg(obj->dev, "%s: a new pte:%p\n", __func__, iopte); } else { @@ -537,7 +537,7 @@ static int iopgd_alloc_section(struct iommu *obj, u32 da, u32 pa, u32 prot) } *iopgd = (pa & IOSECTION_MASK) | prot | IOPGD_SECTION; - flush_iopgd_range(iopgd, iopgd); + flush_iopgd_range(iopgd, iopgd + 1); return 0; } @@ -554,7 +554,7 @@ static int iopgd_alloc_super(struct iommu *obj, u32 da, u32 pa, u32 prot) for (i = 0; i < 16; i++) *(iopgd + i) = (pa & IOSUPER_MASK) | prot | IOPGD_SUPER; - flush_iopgd_range(iopgd, iopgd + 15); + flush_iopgd_range(iopgd, iopgd + 16); return 0; } @@ -567,7 +567,7 @@ static int iopte_alloc_page(struct iommu *obj, u32 da, u32 pa, u32 prot) return PTR_ERR(iopte); *iopte = (pa & IOPAGE_MASK) | prot | IOPTE_SMALL; - flush_iopte_range(iopte, iopte); + flush_iopte_range(iopte, iopte + 1); dev_vdbg(obj->dev, "%s: da:%08x pa:%08x pte:%p *pte:%08x\n", __func__, da, pa, iopte, *iopte); @@ -592,7 +592,7 @@ static int iopte_alloc_large(struct iommu *obj, u32 da, u32 pa, u32 prot) for (i = 0; i < 16; i++) *(iopte + i) = (pa & IOLARGE_MASK) | prot | IOPTE_LARGE; - flush_iopte_range(iopte, iopte + 15); + flush_iopte_range(iopte, iopte + 16); return 0; } @@ -763,7 +763,7 @@ void iopgtable_clear_entry_all(struct iommu *obj) iopte_free(iopte_offset(iopgd, 0)); *iopgd = 0; - flush_iopgd_range(iopgd, iopgd); + flush_iopgd_range(iopgd, iopgd + 1); } flush_iotlb_all(obj);