lkml.org 
[lkml]   [2015]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver
From
Date
On Tue, 2015-07-21 at 15:59 +0100, Will Deacon wrote:
> 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.

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.

>
> > +}
> > +
> > +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.

Sorry, I didn't notice _relax last time. I will improve in next version.
Thanks very much.

>
> Will




\
 
 \ /
  Last update: 2015-07-24 08:01    [W:0.164 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site