Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932694AbbGUO7T (ORCPT ); Tue, 21 Jul 2015 10:59:19 -0400 Received: from foss.arm.com ([217.140.101.70]:60322 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932600AbbGUO7O (ORCPT ); Tue, 21 Jul 2015 10:59:14 -0400 Date: Tue, 21 Jul 2015 15:59:10 +0100 From: Will Deacon To: Yong Wu Cc: Joerg Roedel , Thierry Reding , Mark Rutland , Matthias Brugger , Robin Murphy , Daniel Kurtz , Tomasz Figa , Lucas Stach , Rob Herring , Catalin Marinas , "linux-mediatek@lists.infradead.org" , Sasha Hauer , "srv_heupstream@mediatek.com" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "iommu@lists.linux-foundation.org" , "pebolle@tiscali.nl" , "arnd@arndb.de" , "mitchelh@codeaurora.org" , "cloud.chou@mediatek.com" , "frederic.chen@mediatek.com" Subject: Re: [PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver Message-ID: <20150721145910.GG31095@arm.com> References: <1437037475-9065-1-git-send-email-yong.wu@mediatek.com> <1437037475-9065-6-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437037475-9065-6-git-send-email-yong.wu@mediatek.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1492 Lines: 44 Hi Yong Wu, On Thu, Jul 16, 2015 at 10:04:34AM +0100, Yong Wu wrote: > This patch adds support for mediatek m4u (MultiMedia Memory Management > Unit). [...] > +static void mtk_iommu_tlb_flush_all(void *cookie) > +{ > + struct mtk_iommu_domain *domain = cookie; > + void __iomem *base; > + > + base = domain->data->base; > + writel(F_INVLD_EN1 | F_INVLD_EN0, base + REG_MMU_INV_SEL); > + writel(F_ALL_INVLD, base + REG_MMU_INVALIDATE); This needs to be synchronous, so you probably want to call mtk_iommu_tlb_sync at the end. > +} > + > +static void mtk_iommu_tlb_add_flush(unsigned long iova, size_t size, > + bool leaf, void *cookie) > +{ > + struct mtk_iommu_domain *domain = cookie; > + void __iomem *base = domain->data->base; > + unsigned int iova_start = iova, iova_end = iova + size - 1; > + > + writel(F_INVLD_EN1 | F_INVLD_EN0, base + REG_MMU_INV_SEL); > + > + writel(iova_start, base + REG_MMU_INVLD_START_A); > + writel(iova_end, base + REG_MMU_INVLD_END_A); > + writel(F_MMU_INV_RANGE, base + REG_MMU_INVALIDATE); Why are you using writel instead of writel_relaxed? I asked this before but I don't think you replied. Will -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/