Re: [PATCH 11/21] iommu/mediatek: Add power-domain operation
From: Yong Wu
Date: Thu Aug 06 2020 - 22:14:54 EST
On Mon, 2020-07-27 at 16:49 +0800, chao hao wrote:
> On Sat, 2020-07-11 at 14:48 +0800, Yong Wu wrote:
> > In the previous SoC, the M4U HW is in the EMI power domain which is
> > always on. the latest M4U is in the display power domain which may be
> > turned on/off, thus we have to add pm_runtime interface for it.
> >
> > we should enable its power before M4U hw initial. and disable it after HW
> > initialize.
> >
> > When the engine work, the engine always enable the power and clocks for
> > smi-larb/smi-common, then the M4U's power will always be powered on
> > automatically via the device link with smi-common.
> >
> > Note: we don't enable the M4U power in iommu_map/unmap for tlb flush.
> > If its power already is on, of course it is ok. if the power is off,
> > the main tlb will be reset while M4U power on, thus the tlb flush while
> > m4u power off is unnecessary, just skip it.
> >
> > Signed-off-by: Yong Wu <yong.wu@xxxxxxxxxxxx>
...
> >
> > if (data->plat_data->m4u_plat == M4U_MT8173) {
> > @@ -728,7 +756,15 @@ static int mtk_iommu_probe(struct platform_device *pdev)
> >
> > platform_set_drvdata(pdev, data);
> >
> > + if (dev->pm_domain)
> > + pm_runtime_enable(dev);
>
> hi yong,
>
> If you put "pm_runtime_enable" here, it maybe not device_link with
> smi_common for previous patch:
> if(i || !pm_runtime_enabled(dev))
> continue;
>
> Whether put it up front?
Thanks for review. My fault here. I will fix it.
>
> best regards,
> chao