[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7703076927822fc31d1af37f8fd3bfe5e0513d29.camel@mediatek.com>
Date: Thu, 7 Oct 2021 10:57:01 +0800
From: Yong Wu <yong.wu@...iatek.com>
To: Dafna Hirschfeld <dafna.hirschfeld@...labora.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Joerg Roedel <joro@...tes.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
David Airlie <airlied@...ux.ie>,
"Mauro Carvalho Chehab" <mchehab@...nel.org>
CC: Evan Green <evgreen@...omium.org>,
Robin Murphy <robin.murphy@....com>,
Tomasz Figa <tfiga@...omium.org>,
Will Deacon <will.deacon@....com>,
<linux-mediatek@...ts.infradead.org>,
<srv_heupstream@...iatek.com>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<iommu@...ts.linux-foundation.org>, <youlin.pei@...iatek.com>,
Matthias Kaehlcke <mka@...omium.org>, <anan.sun@...iatek.com>,
<yi.kuo@...iatek.com>, <acourbot@...omium.org>,
<linux-media@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
"Daniel Vetter" <daniel@...ll.ch>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
"Philipp Zabel" <p.zabel@...gutronix.de>,
Tiffany Lin <tiffany.lin@...iatek.com>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Eizan Miyamoto <eizan@...omium.org>,
<anthony.huang@...iatek.com>,
Frank Wunderlich <frank-w@...lic-files.de>,
Irui Wang <irui.wang@...iatek.com>
Subject: Re: [PATCH v8 09/12] media: mtk-vcodec: Get rid of
mtk_smi_larb_get/put
On Thu, 2021-09-30 at 12:57 +0200, Dafna Hirschfeld wrote:
>
> On 30.09.21 05:28, Yong Wu wrote:
> > Hi Dafna,
> >
> > Thanks very much for the review.
> >
> > On Wed, 2021-09-29 at 14:13 +0200, Dafna Hirschfeld wrote:
> > >
> > > On 29.09.21 03:37, Yong Wu wrote:
> > > > MediaTek IOMMU has already added the device_link between the
> > > > consumer
> > > > and smi-larb device. If the vcodec device call the
> > > > pm_runtime_get_sync,
> > > > the smi-larb's pm_runtime_get_sync also be called
> > > > automatically.
> > > >
> > > > CC: Tiffany Lin <tiffany.lin@...iatek.com>
> > > > CC: Irui Wang <irui.wang@...iatek.com>
> > > > Signed-off-by: Yong Wu <yong.wu@...iatek.com>
> > > > Reviewed-by: Evan Green <evgreen@...omium.org>
> > > > Acked-by: Tiffany Lin <tiffany.lin@...iatek.com>
> > > > Reviewed-by: Dafna Hirschfeld <dafna.hirschfeld@...labora.com>
> > > > ---
> > > > .../platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 37 +++----
> > > > -------
> > > > --
> > > > .../platform/mtk-vcodec/mtk_vcodec_drv.h | 3 --
> > > > .../platform/mtk-vcodec/mtk_vcodec_enc.c | 1 -
> > > > .../platform/mtk-vcodec/mtk_vcodec_enc_pm.c | 44 +++----
> > > > -------
[snip]
> > > > void mtk_vcodec_release_dec_pm(struct mtk_vcodec_dev *dev)
> > > > {
> > > > pm_runtime_disable(dev->pm.dev);
> > > > - put_device(dev->pm.larbvdec);
> > > > }
> > >
> > > Now that functions only do 'pm_runtime_disable(dev->pm.dev);' so
> > > it
> > > will be more
> > > readable to remove the function mtk_vcodec_release_dec_pm
> > > and replace with pm_runtime_disable(dev->pm.dev);
> > > Same for the 'enc' equivalent.
> >
> > Make sense. But It may be not proper if using pm_runtime_disable
> > as the symmetry with mtk_vcodec_init_dec_pm in the
> > mtk_vcodec_probe.
> >
> > Maybe we should move pm_runtime_enable out from
> > mtk_vcodec_init_dec_pm
> > into mtk_vcodec_probe. I could do a new patch for this. Is this ok
> > for
> > you?
>
> yes, there is also asymettry when calling pm_runtime* in general,
> I see in the decoder it is called from mtk_vcodec_dec_pm.c
> but in the encoder it is called from mtk_vcodec_enc.c,
>
> I think all calls to pm_runtime* should be out of the *_pm.c files
OK. I will try this.
> since for example 'mtk_vcodec_dec_pw_on' also do just one call to
> pm_runtime_resume_and_get so this function can also be removed.
I guess this one should be reserved to vcodec guys. I see this function
is changed at [1]. Let's keep this patchset clean.
[1]
https://patchwork.kernel.org/project/linux-mediatek/patch/20210901083215.25984-10-yunfei.dong@mediatek.com/
>
> thanks,
> Dafna
>
> >
> > >
> > > Thanks,
> > > Dafna
> >
> > [snip]
> > _______________________________________________
> > Linux-mediatek mailing list
> > Linux-mediatek@...ts.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-mediatek
> >
Powered by blists - more mailing lists