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

2015-04-29 Thread Yong Wu
Dear Tomasz, About a hardcode your comment, please help check below. Dear Mark, I would like to add a item in the dtsi of mtk-iommu. Please also help have a look. > > > +static const struct mtk_iommu_port mtk_iommu_mt8173_port[] = { > > > + /* port namem4uid

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

2015-04-29 Thread Yong Wu
Dear Tomasz, About a hardcode your comment, please help check below. Dear Mark, I would like to add a item in the dtsi of mtk-iommu. Please also help have a look. +static const struct mtk_iommu_port mtk_iommu_mt8173_port[] = { + /* port namem4uid slaveid

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

2015-04-15 Thread Tomasz Figa
On Wed, Apr 15, 2015 at 4:06 PM, Yong Wu wrote: > On Wed, 2015-04-15 at 11:20 +0900, Tomasz Figa wrote: >> On Tue, Apr 14, 2015 at 3:31 PM, Yong Wu wrote: >> >> >> >> >> >> > + >> >> >> > + piommu->protect_va = devm_kmalloc(piommu->dev, >> >> >> > MTK_PROTECT_PA_ALIGN*2, >> >> >> >> >> >>

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

2015-04-15 Thread Yong Wu
On Wed, 2015-04-15 at 11:20 +0900, Tomasz Figa wrote: > On Tue, Apr 14, 2015 at 3:31 PM, Yong Wu wrote: > >> >> > >> >> > + > >> >> > + piommu->protect_va = devm_kmalloc(piommu->dev, > >> >> > MTK_PROTECT_PA_ALIGN*2, > >> >> > >> >> style: Operators like * should have space on both sides.

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

2015-04-15 Thread Yong Wu
On Wed, 2015-04-15 at 11:20 +0900, Tomasz Figa wrote: On Tue, Apr 14, 2015 at 3:31 PM, Yong Wu yong...@mediatek.com wrote: + + piommu-protect_va = devm_kmalloc(piommu-dev, MTK_PROTECT_PA_ALIGN*2, style: Operators like * should have space on both sides. +

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

2015-04-15 Thread Tomasz Figa
On Wed, Apr 15, 2015 at 4:06 PM, Yong Wu yong...@mediatek.com wrote: On Wed, 2015-04-15 at 11:20 +0900, Tomasz Figa wrote: On Tue, Apr 14, 2015 at 3:31 PM, Yong Wu yong...@mediatek.com wrote: + + piommu-protect_va = devm_kmalloc(piommu-dev, MTK_PROTECT_PA_ALIGN*2,

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

2015-04-14 Thread Tomasz Figa
On Tue, Apr 14, 2015 at 3:31 PM, Yong Wu wrote: >> >> >> >> > + >> >> > + piommu->protect_va = devm_kmalloc(piommu->dev, >> >> > MTK_PROTECT_PA_ALIGN*2, >> >> >> >> style: Operators like * should have space on both sides. >> >> >> >> > + GFP_KERNEL);

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

2015-04-14 Thread Yong Wu
Hi Robin, Thanks very much for your confirm. About the v3 of the DMA-mapping, I have some question below. On Fri, 2015-03-20 at 19:14 +, Robin Murphy wrote: > On 18/03/15 11:22, Yong Wu wrote: > > Hi Tomasz, > > Thanks very much for your review. please help check below. > >

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

2015-04-14 Thread Yong Wu
Hi Tomasz, Thanks very much for you suggestion and explain so detail. please help check below. On Fri, 2015-03-27 at 18:41 +0900, Tomasz Figa wrote: > Hi Yong Wu, > > Sorry for long delay, I had to figure out some time to look at this again. > > On Wed, Mar 18, 2015 at 8:22 PM, Yong

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

2015-04-14 Thread Yong Wu
Hi Robin, Thanks very much for your confirm. About the v3 of the DMA-mapping, I have some question below. On Fri, 2015-03-20 at 19:14 +, Robin Murphy wrote: On 18/03/15 11:22, Yong Wu wrote: Hi Tomasz, Thanks very much for your review. please help check below. The

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

2015-04-14 Thread Yong Wu
Hi Tomasz, Thanks very much for you suggestion and explain so detail. please help check below. On Fri, 2015-03-27 at 18:41 +0900, Tomasz Figa wrote: Hi Yong Wu, Sorry for long delay, I had to figure out some time to look at this again. On Wed, Mar 18, 2015 at 8:22 PM, Yong Wu

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

2015-04-14 Thread Tomasz Figa
On Tue, Apr 14, 2015 at 3:31 PM, Yong Wu yong...@mediatek.com wrote: + + piommu-protect_va = devm_kmalloc(piommu-dev, MTK_PROTECT_PA_ALIGN*2, style: Operators like * should have space on both sides. + GFP_KERNEL); Shouldn't

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

2015-03-27 Thread Tomasz Figa
Hi Yong Wu, Sorry for long delay, I had to figure out some time to look at this again. On Wed, Mar 18, 2015 at 8:22 PM, Yong Wu wrote: >> >> > + imudev = piommu->dev; >> > + >> > + spin_lock_irqsave(>portlock, flags); >> >> What is protected by this spinlock? > We

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

2015-03-27 Thread Tomasz Figa
Hi Yong Wu, Sorry for long delay, I had to figure out some time to look at this again. On Wed, Mar 18, 2015 at 8:22 PM, Yong Wu yong...@mediatek.com wrote: + imudev = piommu-dev; + + spin_lock_irqsave(priv-portlock, flags); What is protected by this spinlock?

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

2015-03-20 Thread Robin Murphy
On 18/03/15 11:22, Yong Wu wrote: Hi Tomasz, Thanks very much for your review. please help check below. The others I will fix in the next version. Hi Robin, There are some place I would like you can have a look and give me some suggestion. On Wed, 2015-03-11 at 19:53 +0900, Tomasz Figa

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

2015-03-20 Thread Robin Murphy
On 18/03/15 11:22, Yong Wu wrote: Hi Tomasz, Thanks very much for your review. please help check below. The others I will fix in the next version. Hi Robin, There are some place I would like you can have a look and give me some suggestion. On Wed, 2015-03-11 at 19:53 +0900, Tomasz Figa

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

2015-03-18 Thread Yong Wu
Hi Tomasz, Thanks very much for your review. please help check below. The others I will fix in the next version. Hi Robin, There are some place I would like you can have a look and give me some suggestion. On Wed, 2015-03-11 at 19:53 +0900, Tomasz Figa wrote: > Hi, > > Please find next

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

2015-03-18 Thread Yong Wu
Hi Tomasz, Thanks very much for your review. please help check below. The others I will fix in the next version. Hi Robin, There are some place I would like you can have a look and give me some suggestion. On Wed, 2015-03-11 at 19:53 +0900, Tomasz Figa wrote: Hi, Please find next part

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

2015-03-17 Thread Will Deacon
On Mon, Mar 09, 2015 at 12:11:43PM +, Yong Wu wrote: > On Fri, 2015-03-06 at 10:58 +, Will Deacon wrote: > > On Fri, Mar 06, 2015 at 10:48:17AM +, yong...@mediatek.com wrote: > > > From: Yong Wu > > > > > > This patch adds support for mediatek m4u (MultiMedia Memory Management > > >

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

2015-03-17 Thread Will Deacon
On Mon, Mar 09, 2015 at 12:11:43PM +, Yong Wu wrote: On Fri, 2015-03-06 at 10:58 +, Will Deacon wrote: On Fri, Mar 06, 2015 at 10:48:17AM +, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com This patch adds support for mediatek m4u (MultiMedia Memory

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

2015-03-12 Thread Yong Wu
Dear Tomasz, Thanks very much for review so detail! Please check my reply below. Others I will fix it in the next version. And I have got your comment of [2/5]. Do you have plan for the other patch? On Sun, 2015-03-08 at 13:12 +0900, Tomasz Figa wrote: > Hi Yong Wu, >

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

2015-03-12 Thread Yong Wu
Dear Tomasz, Thanks very much for review so detail! Please check my reply below. Others I will fix it in the next version. And I have got your comment of [2/5]. Do you have plan for the other patch? On Sun, 2015-03-08 at 13:12 +0900, Tomasz Figa wrote: Hi Yong Wu,

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

2015-03-11 Thread Tomasz Figa
Hi, Please find next part of my comments inline. On Fri, Mar 6, 2015 at 7:48 PM, wrote: [snip] > +/* > + * pimudev is a global var for dma_alloc_coherent. > + * It is not accepatable, we will delete it if "domain_alloc" is enabled It looks like we indeed need to use dma_alloc_coherent() and

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

2015-03-11 Thread Tomasz Figa
Hi, Please find next part of my comments inline. On Fri, Mar 6, 2015 at 7:48 PM, yong...@mediatek.com wrote: [snip] +/* + * pimudev is a global var for dma_alloc_coherent. + * It is not accepatable, we will delete it if domain_alloc is enabled It looks like we indeed need to use

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

2015-03-09 Thread Tomasz Figa
On Tue, Mar 10, 2015 at 12:41 PM, Yingjoe Chen wrote: > On Tue, 2015-03-10 at 02:00 +0900, Tomasz Figa wrote: >> On Mon, Mar 9, 2015 at 11:46 PM, Yingjoe Chen >> wrote: >> > On Mon, 2015-03-09 at 20:11 +0900, Tomasz Figa wrote: >> > <...> >> >> > +/* >> >> > + * pimudev is a global var for

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

2015-03-09 Thread Yingjoe Chen
On Tue, 2015-03-10 at 02:00 +0900, Tomasz Figa wrote: > On Mon, Mar 9, 2015 at 11:46 PM, Yingjoe Chen > wrote: > > On Mon, 2015-03-09 at 20:11 +0900, Tomasz Figa wrote: > > <...> > >> > +/* > >> > + * pimudev is a global var for dma_alloc_coherent. > >> > + * It is not accepatable, we will

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

2015-03-09 Thread Tomasz Figa
On Mon, Mar 9, 2015 at 11:46 PM, Yingjoe Chen wrote: > On Mon, 2015-03-09 at 20:11 +0900, Tomasz Figa wrote: > <...> >> > +/* >> > + * pimudev is a global var for dma_alloc_coherent. >> > + * It is not accepatable, we will delete it if "domain_alloc" is enabled >> > + */ >> > +static struct

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

2015-03-09 Thread Mitchel Humpherys
On Mon, Mar 09 2015 at 05:16:26 AM, Yong Wu wrote: > Dear Mitchel, > Thanks very much for your review. > > On Fri, 2015-03-06 at 09:15 -0800, Mitchel Humpherys wrote: >> On Fri, Mar 06 2015 at 02:48:17 AM, wrote: >> > From: Yong Wu >> > >> > This patch adds support for mediatek m4u

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

2015-03-09 Thread Yingjoe Chen
On Mon, 2015-03-09 at 20:11 +0900, Tomasz Figa wrote: <...> > > +/* > > + * pimudev is a global var for dma_alloc_coherent. > > + * It is not accepatable, we will delete it if "domain_alloc" is enabled > > + */ > > +static struct device *pimudev; > > This is indeed not acceptable. Could you

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

2015-03-09 Thread Yong Wu
Dear Mitchel, Thanks very much for your review. On Fri, 2015-03-06 at 09:15 -0800, Mitchel Humpherys wrote: > On Fri, Mar 06 2015 at 02:48:17 AM, wrote: > > From: Yong Wu > > > > This patch adds support for mediatek m4u (MultiMedia Memory Management > > Unit). > > Currently this only

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

2015-03-09 Thread Yong Wu
Dear Will, On Fri, 2015-03-06 at 10:58 +, Will Deacon wrote: > On Fri, Mar 06, 2015 at 10:48:17AM +, yong...@mediatek.com wrote: > > From: Yong Wu > > > > This patch adds support for mediatek m4u (MultiMedia Memory Management > > Unit). > > Currently this only supports m4u gen 2 with 2

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

2015-03-09 Thread Tomasz Figa
Hi, You can find part 2 of my comments inline. On Fri, Mar 6, 2015 at 7:48 PM, wrote: [snip] > +static irqreturn_t mtk_iommu_isr(int irq, void *dev_id) > +{ > + struct iommu_domain *domain = dev_id; > + struct mtk_iommu_domain *mtkdomain = domain->priv; > + struct

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

2015-03-09 Thread Daniel Kurtz
Hi Yong Wu, On Fri, Mar 6, 2015 at 6:48 PM, wrote: > From: Yong Wu > > This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). > Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. > > Signed-off-by: Yong Wu > --- > drivers/iommu/Kconfig

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

2015-03-09 Thread Yong Wu
Dear Mitchel, Thanks very much for your review. On Fri, 2015-03-06 at 09:15 -0800, Mitchel Humpherys wrote: On Fri, Mar 06 2015 at 02:48:17 AM, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com This patch adds support for mediatek m4u (MultiMedia Memory Management

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

2015-03-09 Thread Tomasz Figa
Hi, You can find part 2 of my comments inline. On Fri, Mar 6, 2015 at 7:48 PM, yong...@mediatek.com wrote: [snip] +static irqreturn_t mtk_iommu_isr(int irq, void *dev_id) +{ + struct iommu_domain *domain = dev_id; + struct mtk_iommu_domain *mtkdomain = domain-priv; +

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

2015-03-09 Thread Yong Wu
Dear Will, On Fri, 2015-03-06 at 10:58 +, Will Deacon wrote: On Fri, Mar 06, 2015 at 10:48:17AM +, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Currently this only supports m4u gen

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

2015-03-09 Thread Yingjoe Chen
On Mon, 2015-03-09 at 20:11 +0900, Tomasz Figa wrote: ... +/* + * pimudev is a global var for dma_alloc_coherent. + * It is not accepatable, we will delete it if domain_alloc is enabled + */ +static struct device *pimudev; This is indeed not acceptable. Could you replace

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

2015-03-09 Thread Mitchel Humpherys
On Mon, Mar 09 2015 at 05:16:26 AM, Yong Wu yong...@mediatek.com wrote: Dear Mitchel, Thanks very much for your review. On Fri, 2015-03-06 at 09:15 -0800, Mitchel Humpherys wrote: On Fri, Mar 06 2015 at 02:48:17 AM, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com

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

2015-03-09 Thread Tomasz Figa
On Mon, Mar 9, 2015 at 11:46 PM, Yingjoe Chen yingjoe.c...@mediatek.com wrote: On Mon, 2015-03-09 at 20:11 +0900, Tomasz Figa wrote: ... +/* + * pimudev is a global var for dma_alloc_coherent. + * It is not accepatable, we will delete it if domain_alloc is enabled + */ +static struct

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

2015-03-09 Thread Yingjoe Chen
On Tue, 2015-03-10 at 02:00 +0900, Tomasz Figa wrote: On Mon, Mar 9, 2015 at 11:46 PM, Yingjoe Chen yingjoe.c...@mediatek.com wrote: On Mon, 2015-03-09 at 20:11 +0900, Tomasz Figa wrote: ... +/* + * pimudev is a global var for dma_alloc_coherent. + * It is not accepatable, we will

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

2015-03-09 Thread Tomasz Figa
On Tue, Mar 10, 2015 at 12:41 PM, Yingjoe Chen yingjoe.c...@mediatek.com wrote: On Tue, 2015-03-10 at 02:00 +0900, Tomasz Figa wrote: On Mon, Mar 9, 2015 at 11:46 PM, Yingjoe Chen yingjoe.c...@mediatek.com wrote: On Mon, 2015-03-09 at 20:11 +0900, Tomasz Figa wrote: ... +/* + *

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

2015-03-09 Thread Daniel Kurtz
Hi Yong Wu, On Fri, Mar 6, 2015 at 6:48 PM, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. Signed-off-by: Yong Wu

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

2015-03-07 Thread Tomasz Figa
Hi Yong Wu, Thanks for this series. Please see my comments inline. On Fri, Mar 6, 2015 at 7:48 PM, wrote: > From: Yong Wu > > This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). > Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. [snip]

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

2015-03-07 Thread Tomasz Figa
Hi Yong Wu, Thanks for this series. Please see my comments inline. On Fri, Mar 6, 2015 at 7:48 PM, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Currently this only supports m4u gen 2 with 2

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

2015-03-06 Thread Mitchel Humpherys
On Fri, Mar 06 2015 at 02:48:17 AM, wrote: > From: Yong Wu > > This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). > Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. [...] > +static int mtk_iommu_invalidate_tlb(const struct mtk_iommu_info

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

2015-03-06 Thread Will Deacon
On Fri, Mar 06, 2015 at 10:48:17AM +, yong...@mediatek.com wrote: > From: Yong Wu > > This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). > Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. [...] > diff --git

[PATCH 2/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-03-06 Thread yong.wu
From: Yong Wu This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. Signed-off-by: Yong Wu --- drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile | 1 +

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

2015-03-06 Thread Will Deacon
On Fri, Mar 06, 2015 at 10:48:17AM +, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. [...] diff --git

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

2015-03-06 Thread Mitchel Humpherys
On Fri, Mar 06 2015 at 02:48:17 AM, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. [...] +static int

[PATCH 2/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-03-06 Thread yong.wu
From: Yong Wu yong...@mediatek.com This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Currently this only supports m4u gen 2 with 2 levels of page table on mt8173. Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/iommu/Kconfig | 11 +