From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4C4DC433E0 for ; Thu, 18 Jun 2020 09:34:54 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F4B821BE5 for ; Thu, 18 Jun 2020 09:34:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="MHeeNIj+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F4B821BE5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7D2C7871A7; Thu, 18 Jun 2020 09:34:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4dEoL_2MUTTB; Thu, 18 Jun 2020 09:34:53 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6551F8715A; Thu, 18 Jun 2020 09:34:53 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 59202C088C; Thu, 18 Jun 2020 09:34:53 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id C2301C016E for ; Thu, 18 Jun 2020 09:34:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BE25E88380 for ; Thu, 18 Jun 2020 09:34:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F2-d6QGJ4tU8 for ; Thu, 18 Jun 2020 09:34:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailgw01.mediatek.com (unknown [1.203.163.78]) by whitealder.osuosl.org (Postfix) with ESMTP id 7708F87BFE for ; Thu, 18 Jun 2020 09:34:49 +0000 (UTC) X-UUID: 855350d237af447598937a20df6f1057-20200618 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=fazQeAs8inAvGwYcQXqBGXqOlhYwCeTQdth0t/3tLpc=; b=MHeeNIj++emO1PxnCKYQiheDFmpZ4QBACfg0h4/OsDUonE38uDizhI+ibfWfeYHrZWzdKmqjA4pspetmXciZRh0aMpC3nZVDYa6Z/T8lj5eJdfJoht83VIS8lU3VV4mz8emEXDFGXanQq7R5q4LS8CnMUfrDFmNHFsNV7hCie9k=; X-UUID: 855350d237af447598937a20df6f1057-20200618 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1739908511; Thu, 18 Jun 2020 17:34:39 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 18 Jun 2020 17:34:36 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 18 Jun 2020 17:34:33 +0800 Message-ID: <1592472725.20080.12.camel@mhfsdcap03> Subject: Re: [PATCH v4 06/17] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put From: Yong Wu To: Matthias Brugger , Rick Chang Date: Thu, 18 Jun 2020 17:32:05 +0800 In-Reply-To: <1590826218-23653-7-git-send-email-yong.wu@mediatek.com> References: <1590826218-23653-1-git-send-email-yong.wu@mediatek.com> <1590826218-23653-7-git-send-email-yong.wu@mediatek.com> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: EAA0222707355DB3D9C41720DD63D68CCECEA4A8CC20861737BF3012552CC6C52000:8 X-MTK: N Cc: xia.jiang@mediatek.com, Will Deacon , youlin.pei@mediatek.com, Nicolas Boichat , Rick Chang , Evan Green , eizan@chromium.org, Matthias Kaehlcke , devicetree@vger.kernel.org, cui.zhang@mediatek.com, Tomasz Figa , Rob Herring , linux-mediatek@lists.infradead.org, ming-fan.chen@mediatek.com, linux-arm-kernel@lists.infradead.org, anan.sun@mediatek.com, acourbot@chromium.org, srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, chao.hao@mediatek.com, iommu@lists.linux-foundation.org, Robin Murphy X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" + Rick On Sat, 2020-05-30 at 16:10 +0800, 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. > > CC: Rick Chang > Signed-off-by: Yong Wu > Reviewed-by: Evan Green > --- > 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 f82a81a..21fba6f 100644 > --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c > +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c > @@ -21,7 +21,6 @@ > #include > #include > #include > -#include > > #include "mtk_jpeg_hw.h" > #include "mtk_jpeg_core.h" > @@ -893,11 +892,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); > } > @@ -906,7 +900,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) > @@ -1051,21 +1044,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 999bd14..8579494 100644 > --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h > +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h > @@ -47,7 +47,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; > @@ -61,7 +60,6 @@ struct mtk_jpeg_dev { > void __iomem *dec_reg_base; > struct clk *clk_jdec; > struct clk *clk_jdec_smi; > - struct device *larb; > }; > > /** _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu