Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1192650

Re: [PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Yong Wu <yong.wu@mediatek.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver
Date Mon, 27 Jul 2015 06:30:01 +0200
Message-ID <pQId3-7Ap-5@gated-at.bofh.it> (permalink)
References <pMNkZ-27A-3@gated-at.bofh.it> <pMNkZ-27A-1@gated-at.bofh.it> <pOHbs-313-25@gated-at.bofh.it> <pPE1P-4X1-5@gated-at.bofh.it> <pPOue-3ci-5@gated-at.bofh.it>
X-Original-To Will Deacon <will.deacon@arm.com>
X-Listener-Flag 11101
Content-Type text/plain; charset="UTF-8"
X-Mailer Evolution 3.2.3-0ubuntu6
Content-Transfer-Encoding 7bit
MIME-Version 1.0
X-Mtk N
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc Joerg Roedel <joro@8bytes.org>, Thierry Reding <treding@nvidia.com>, Mark Rutland <Mark.Rutland@arm.com>, Matthias Brugger <matthias.bgg@gmail.com>, Robin Murphy <Robin.Murphy@arm.com>, Daniel Kurtz <djkurtz@google.com>, Tomasz Figa <tfiga@google.com>, Lucas Stach <l.stach@pengutronix.de>, Rob Herring <robh+dt@kernel.org>, Catalin Marinas <Catalin.Marinas@arm.com>, "linux-mediatek@lists.infradead.org" <linux-mediatek@lists.infradead.org>, Sasha Hauer <kernel@pengutronix.de>, "srv_heupstream@mediatek.com" <srv_heupstream@mediatek.com>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, "iommu@lists.linux-foundation.org" <iommu@lists.linux-foundation.org>, "pebolle@tiscali.nl" <pebolle@tiscali.nl>, "arnd@arndb.de" <arnd@arndb.de>, "mitchelh@codeaurora.org" <mitchelh@codeaurora.org>, "cloud.chou@mediatek.com" <cloud.chou@mediatek.com>, "frederic.chen@mediatek.com" <frederic.chen@mediatek.com>
X-Original-Date Mon, 27 Jul 2015 12:24:31 +0800
X-Original-Message-ID <1437971071.25925.24.camel@mhfsdcap03>
X-Original-References <1437037475-9065-1-git-send-email-yong.wu@mediatek.com> <1437037475-9065-6-git-send-email-yong.wu@mediatek.com> <20150721145910.GG31095@arm.com> <1437716593.23932.73.camel@mhfsdcap03> <20150724165509.GD21177@arm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1192650

Show key headers only | View raw


On Fri, 2015-07-24 at 17:55 +0100, Will Deacon wrote:
> On Fri, Jul 24, 2015 at 06:43:13AM +0100, Yong Wu wrote:
> > On Tue, 2015-07-21 at 15:59 +0100, Will Deacon wrote:
> > > On Thu, Jul 16, 2015 at 10:04:34AM +0100, Yong Wu wrote:
> > > > +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.
> > 
> > From our spec, we have to wait until HW done after tlb flush range.
> > But it don't need wait after tlb flush all.
> > so It isn't necessary to add mtk_iommu_tlb_sync in tlb_flush_all here.
> 
> Okey doke, but I'm surprised you don't need a subsequent DSB or read-back.
> What if the writel is buffered on the way to the IOMMU?

Then I change to this:
 //==========
    writel_relaxed(F_INVLD_EN1 | F_INVLD_EN0, base + REG_MMU_INV_SEL);
    writel_relaxed(F_ALL_INVLD, base + REG_MMU_INVALIDATE);    
    dsb(ishst);
//===========
    dsb or mb(). which one is better here?

> 
> 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/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver Yong Wu <yong.wu@mediatek.com> - 2015-07-27 06:30 +0200

csiph-web