lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1561171355.4850.7.camel@mhfsdcap03>
Date:   Sat, 22 Jun 2019 10:42:35 +0800
From:   Yong Wu <yong.wu@...iatek.com>
To:     Matthias Brugger <matthias.bgg@...il.com>
CC:     Joerg Roedel <joro@...tes.org>, Rob Herring <robh+dt@...nel.org>,
        "Evan Green" <evgreen@...omium.org>,
        Robin Murphy <robin.murphy@....com>,
        "Tomasz Figa" <tfiga@...gle.com>,
        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>, <yingjoe.chen@...iatek.com>,
        <youlin.pei@...iatek.com>, Nicolas Boichat <drinkcat@...omium.org>,
        <anan.sun@...iatek.com>, Rick Chang <rick.chang@...iatek.com>
Subject: Re: [PATCH v2 05/12] media: mtk-jpeg: Get rid of
 mtk_smi_larb_get/put

On Thu, 2019-06-20 at 17:20 +0200, Matthias Brugger wrote:
> 
> On 10/06/2019 14:55, Yong Wu wrote:
> > MediaTek IOMMU has already added device_link between the consumer
> > and smi-larb device. If the jpg device call the pm_runtime_get_sync,
> > the smi-larb's pm_runtime_get_sync also be called automatically.
> 
> Please help me out find this relation. I seem to miss something basic, because I
> can't find any between the jpeg IP and the iommu.

JPEG also is a multimedia consumer. It also access memory via IOMMU. All
the current SoC have the JPG smi ports. 

grep -r JPG include/dt-bindings/memory/mt*

> 
> Regards,
> Matthias
> 
> > 
> > CC: Rick Chang <rick.chang@...iatek.com>
> > Signed-off-by: Yong Wu <yong.wu@...iatek.com>
> > Reviewed-by: Evan Green <evgreen@...omium.org>
> > ---
> >  drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 22 ----------------------
> >  drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h |  2 --
> >  2 files changed, 24 deletions(-)
> > 
> > diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> > index f761e4d..2f37538 100644
> > --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> > +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> > @@ -29,7 +29,6 @@
> >  #include <media/v4l2-ioctl.h>
> >  #include <media/videobuf2-core.h>
> >  #include <media/videobuf2-dma-contig.h>
> > -#include <soc/mediatek/smi.h>
> >  
> >  #include "mtk_jpeg_hw.h"
> >  #include "mtk_jpeg_core.h"
> > @@ -901,11 +900,6 @@ static int mtk_jpeg_queue_init(void *priv, struct vb2_queue *src_vq,
> >  
> >  static void mtk_jpeg_clk_on(struct mtk_jpeg_dev *jpeg)
> >  {
> > -	int ret;
> > -
> > -	ret = mtk_smi_larb_get(jpeg->larb);
> > -	if (ret)
> > -		dev_err(jpeg->dev, "mtk_smi_larb_get larbvdec fail %d\n", ret);
> >  	clk_prepare_enable(jpeg->clk_jdec_smi);
> >  	clk_prepare_enable(jpeg->clk_jdec);
> >  }
> > @@ -914,7 +908,6 @@ static void mtk_jpeg_clk_off(struct mtk_jpeg_dev *jpeg)
> >  {
> >  	clk_disable_unprepare(jpeg->clk_jdec);
> >  	clk_disable_unprepare(jpeg->clk_jdec_smi);
> > -	mtk_smi_larb_put(jpeg->larb);
> >  }
> >  
> >  static irqreturn_t mtk_jpeg_dec_irq(int irq, void *priv)
> > @@ -1059,21 +1052,6 @@ static int mtk_jpeg_release(struct file *file)
> >  
> >  static int mtk_jpeg_clk_init(struct mtk_jpeg_dev *jpeg)
> >  {
> > -	struct device_node *node;
> > -	struct platform_device *pdev;
> > -
> > -	node = of_parse_phandle(jpeg->dev->of_node, "mediatek,larb", 0);
> > -	if (!node)
> > -		return -EINVAL;
> > -	pdev = of_find_device_by_node(node);
> > -	if (WARN_ON(!pdev)) {
> > -		of_node_put(node);
> > -		return -EINVAL;
> > -	}
> > -	of_node_put(node);
> > -
> > -	jpeg->larb = &pdev->dev;
> > -
> >  	jpeg->clk_jdec = devm_clk_get(jpeg->dev, "jpgdec");
> >  	if (IS_ERR(jpeg->clk_jdec))
> >  		return PTR_ERR(jpeg->clk_jdec);
> > diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h
> > index 1a6cdfd..e35fb79 100644
> > --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h
> > +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h
> > @@ -55,7 +55,6 @@ enum mtk_jpeg_ctx_state {
> >   * @dec_reg_base:	JPEG registers mapping
> >   * @clk_jdec:		JPEG hw working clock
> >   * @clk_jdec_smi:	JPEG SMI bus clock
> > - * @larb:		SMI device
> >   */
> >  struct mtk_jpeg_dev {
> >  	struct mutex		lock;
> > @@ -69,7 +68,6 @@ struct mtk_jpeg_dev {
> >  	void __iomem		*dec_reg_base;
> >  	struct clk		*clk_jdec;
> >  	struct clk		*clk_jdec_smi;
> > -	struct device		*larb;
> >  };
> >  
> >  /**
> > 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ