[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1609241112.26323.299.camel@mhfsdcap03>
Date: Tue, 29 Dec 2020 19:25:12 +0800
From: Yong Wu <yong.wu@...iatek.com>
To: Tomasz Figa <tfiga@...omium.org>
CC: Joerg Roedel <joro@...tes.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>, <youlin.pei@...iatek.com>,
<devicetree@...r.kernel.org>,
Nicolas Boichat <drinkcat@...omium.org>,
<srv_heupstream@...iatek.com>, <chao.hao@...iatek.com>,
<linux-kernel@...r.kernel.org>, Evan Green <evgreen@...omium.org>,
Tomasz Figa <tfiga@...gle.com>,
<iommu@...ts.linux-foundation.org>,
<linux-mediatek@...ts.infradead.org>,
Krzysztof Kozlowski <krzk@...nel.org>, <anan.sun@...iatek.com>,
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v5 16/27] iommu/mediatek: Add device link for smi-common
and m4u
On Wed, 2020-12-23 at 17:29 +0900, Tomasz Figa wrote:
> On Wed, Dec 09, 2020 at 04:00:51PM +0800, Yong Wu wrote:
> > In the lastest SoC, M4U has its special power domain. thus, If the engine
> > begin to work, it should help enable the power for M4U firstly.
> > Currently if the engine work, it always enable the power/clocks for
> > smi-larbs/smi-common. This patch adds device_link for smi-common and M4U.
> > then, if smi-common power is enabled, the M4U power also is powered on
> > automatically.
> >
> > Normally M4U connect with several smi-larbs and their smi-common always
> > are the same, In this patch it get smi-common dev from the first smi-larb
> > device(i==0), then add the device_link only while m4u has power-domain.
> >
> > Signed-off-by: Yong Wu <yong.wu@...iatek.com>
> > ---
> > drivers/iommu/mtk_iommu.c | 30 ++++++++++++++++++++++++++++--
> > drivers/iommu/mtk_iommu.h | 1 +
> > 2 files changed, 29 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
> > index 09c8c58feb78..5614015e5b96 100644
> > --- a/drivers/iommu/mtk_iommu.c
> > +++ b/drivers/iommu/mtk_iommu.c
> > @@ -20,6 +20,7 @@
> > #include <linux/of_irq.h>
> > #include <linux/of_platform.h>
> > #include <linux/platform_device.h>
> > +#include <linux/pm_runtime.h>
> > #include <linux/regmap.h>
> > #include <linux/slab.h>
> > #include <linux/spinlock.h>
> > @@ -706,7 +707,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
> > return larb_nr;
> >
> > for (i = 0; i < larb_nr; i++) {
> > - struct device_node *larbnode;
> > + struct device_node *larbnode, *smicomm_node;
> > struct platform_device *plarbdev;
> > u32 id;
> >
> > @@ -732,6 +733,26 @@ static int mtk_iommu_probe(struct platform_device *pdev)
> >
> > component_match_add_release(dev, &match, release_of,
> > compare_of, larbnode);
> > + if (i != 0)
> > + continue;
>
> How about using the last larb instead and moving the code below outside
> of the loop?
Of course OK. Thanks.
Powered by blists - more mailing lists