Re: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-25 Thread Arnd Bergmann
On Wednesday, May 25, 2016 6:49:18 PM CEST Sricharan wrote: > Hi Arnd, > > >> Ok, so i was doing this from the idea that, other iommu drivers > >> where polling on a status bit in their sync call to ensure completion > >> of pending TLB invalidations. But in this case, there is no status bit. >

Re: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-25 Thread Arnd Bergmann
On Wednesday, May 25, 2016 4:15:31 PM CEST Sricharan wrote: > > > >Any operation that could trigger a DMA from a device is required > >to have a barrier preceding it (usually wmb() one implied by writel()), > >so this is clearly not about a driver that installs a DMA mapping > >before starting a

RE: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-25 Thread Sricharan
Hi Arnd, >> I had measured the numbers only for the full usecase path, not for the >> reset path alone. I saw improvement of about 5% on full numbers. >> As you said, the reset path would be called only less often >> and might not bring a measurable change. I did not see a difference in >>

Re: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-24 Thread Arnd Bergmann
On Monday, May 23, 2016 11:35:04 AM CEST Sricharan wrote: > Hi Arnd, > > >> @@ -124,6 +124,9 @@ static void msm_iommu_reset(void __iomem *base, int > >> ncb) > >>SET_TLBLKCR(base, ctx, 0); > >>SET_CONTEXTIDR(base, ctx, 0); > >>} > >> + > >> + /* Ensure completion of

RE: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-23 Thread Sricharan
Hi Arnd, >> @@ -124,6 +124,9 @@ static void msm_iommu_reset(void __iomem *base, int ncb) >> SET_TLBLKCR(base, ctx, 0); >> SET_CONTEXTIDR(base, ctx, 0); >> } >> + >> +/* Ensure completion of relaxed writes from the above SET macros */ >> +mb(); >> } > >Why

Re: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-20 Thread Arnd Bergmann
On Friday 20 May 2016 13:44:10 Arnd Bergmann wrote: > > #define GET_CTX_REG(reg, base, ctx) \ > > (readl((base) + (reg) + ((ctx) << CTX_SHIFT))) > > > > -#define SET_GLOBAL_REG(reg, base, val) writel((val), ((base) + > > (reg))) > > +/* > > + * The writes to

Re: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-20 Thread Arnd Bergmann
On Friday 20 May 2016 16:24:53 Sricharan R wrote: > While using the generic pagetable ops the tlb maintenance > operation gets completed in the sync callback. So use writel_relaxed > for all register access and add a mb() at appropriate places. > > Signed-off-by: Sricharan R