Re: [PATCH] iommu/mediatek: Fix protect memory setting

2018-03-21 Thread Yong Wu
On Wed, 2018-03-21 at 06:14 -0500, Joerg Roedel wrote: > On Wed, Mar 21, 2018 at 01:18:24PM +0800, Yong Wu wrote: > > On Tue, 2018-03-20 at 13:57 -0500, Joerg Roedel wrote: > > > On Sun, Mar 18, 2018 at 09:52:54AM +0800, Yong Wu wrote: > > > > To avoid adding this complex macro or a new function,

Re: [PATCH] iommu/mediatek: Fix protect memory setting

2018-03-21 Thread Joerg Roedel
On Wed, Mar 21, 2018 at 01:18:24PM +0800, Yong Wu wrote: > On Tue, 2018-03-20 at 13:57 -0500, Joerg Roedel wrote: > > On Sun, Mar 18, 2018 at 09:52:54AM +0800, Yong Wu wrote: > > > To avoid adding this complex macro or a new function, I put > > > it in the code and backup its value in the suspend

Re: [PATCH] iommu/mediatek: Fix protect memory setting

2018-03-20 Thread Yong Wu
Hi Joerg, On Tue, 2018-03-20 at 13:57 -0500, Joerg Roedel wrote: > On Sun, Mar 18, 2018 at 09:52:54AM +0800, Yong Wu wrote: > > To avoid adding this complex macro or a new function, I put > > it in the code and backup its value in the suspend registers. > > Missing Signed-off-by. Signed-off-by

Re: [PATCH] iommu/mediatek: Fix protect memory setting

2018-03-20 Thread Joerg Roedel
On Sun, Mar 18, 2018 at 09:52:54AM +0800, Yong Wu wrote: > To avoid adding this complex macro or a new function, I put > it in the code and backup its value in the suspend registers. Missing Signed-off-by. > --- > drivers/iommu/mtk_iommu.c | 15 ++- > drivers/iommu/mtk_iommu.h | 1

[PATCH] iommu/mediatek: Fix protect memory setting

2018-03-17 Thread Yong Wu
In MediaTek's IOMMU design, When a iommu translation fault occurs (HW can NOT translate the destination address to a valid physical address), the IOMMU HW output the dirty data into a special memory to avoid corrupting the main memory, this is called "protect memory". the register(0x114) for