Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp190971pxv; Wed, 14 Jul 2021 01:32:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyDYfxGn7wRse0ymNva0OxpHSYDVBnPQuk/W6zi0brJcdPgrFaQluJG9vw0UAGz7JzktL0 X-Received: by 2002:a17:907:2d8a:: with SMTP id gt10mr11308734ejc.10.1626251555479; Wed, 14 Jul 2021 01:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626251555; cv=none; d=google.com; s=arc-20160816; b=q3OytiDnlEu+FKEaUCzr7G0BLbcPblJjl59y812a7A0uLe/tfdxJp8TmTNmyUmdxbj 8tfrGC12uO+vAlHqKMzczLFU/mE2dsxQ8h6rVKV6jf5mt/KdoF9St+yM8XrdHEJ6cO6w VIbpoBv0TaKPTGv2/SkYbTrLq5GX1mQlruQMgygDzywEFV1adVmoF9nMxZG7kqPZO89l cteyvgEDTlGOOsuAJZEjwhBjNyQczJQI5CrBR/96QhFW7tURlgLl8zxSbxexZUrURQhE E5FHG3EfM2ddJa2WA7nIUeBHWFQSCexONFyHuY+gUWuP0Y32N/sG0/I3DXBiZ1dv+ZlE tCZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=W5AwWi7Mvj0D23F92uWgihtprTv8y4HU4ElYRlliONc=; b=Ywt+G9UnID6Hu/Kl10gaq4H6wsarhPfzPj81iOvfNxDzO5JNNrliRnWcXP79cqG9st UQPD3tASEuGntjYPV3UB1kQFrelBjp87ML16RKfHcI2kRPpgKK++TzoMtlz9rD6zWUl1 ccTNxmiyEePYYYmWAN7Ihak7kf0mPz04QHPd6Lr+jQ2I69TTMKxOmuVtjRRytYjVzAD7 F6QTcH4fb/bOAgqhuJHJyN7mOtIy0mlstjz4lUvFkJx8yYYe8e492NOErCQDryJd0vMf 4bGjukwMWylX6xTltI23xpk+dLH+XM1kGyXWB3H1CxU9tX+842xHxrmtxlf/6IGRkW6J NBPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s1si1925226ejs.746.2021.07.14.01.32.12; Wed, 14 Jul 2021 01:32:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238540AbhGNIcG (ORCPT + 99 others); Wed, 14 Jul 2021 04:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229940AbhGNIcF (ORCPT ); Wed, 14 Jul 2021 04:32:05 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87F30C06175F; Wed, 14 Jul 2021 01:29:14 -0700 (PDT) Received: from [IPv6:2a02:810a:880:f54:e49e:3ed0:1a77:5623] (unknown [IPv6:2a02:810a:880:f54:e49e:3ed0:1a77:5623]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 3997C1F42822; Wed, 14 Jul 2021 09:29:12 +0100 (BST) Subject: Re: [PATCH v6 05/11] media: mtk-mdp: Get rid of mtk_smi_larb_get/put To: Yong Wu , Matthias Brugger , Joerg Roedel , Rob Herring , Krzysztof Kozlowski , David Airlie , Mauro Carvalho Chehab Cc: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, youlin.pei@mediatek.com, Nicolas Boichat , Matthias Kaehlcke , anan.sun@mediatek.com, ming-fan.chen@mediatek.com, yi.kuo@mediatek.com, acourbot@chromium.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Xia Jiang , Tiffany Lin , Hsin-Yi Wang , Eizan Miyamoto , anthony.huang@mediatek.com, Minghsiu Tsai , Houlong Wei References: <20210714025626.5528-1-yong.wu@mediatek.com> <20210714025626.5528-6-yong.wu@mediatek.com> From: Dafna Hirschfeld Message-ID: Date: Wed, 14 Jul 2021 10:29:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210714025626.5528-6-yong.wu@mediatek.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14.07.21 04:56, Yong Wu wrote: > MediaTek IOMMU has already added the device_link between the consumer > and smi-larb device. If the mdp device call the pm_runtime_get_sync, > the smi-larb's pm_runtime_get_sync also be called automatically. > > CC: Minghsiu Tsai > CC: Houlong Wei > Signed-off-by: Yong Wu > Reviewed-by: Evan Green > Reviewed-by: Houlong Wei Reviewed-by: Dafna Hirschfeld > --- > drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 46 +------------------ > drivers/media/platform/mtk-mdp/mtk_mdp_comp.h | 2 - > drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 1 - > 3 files changed, 1 insertion(+), 48 deletions(-) > > diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c > index de2d425efdd1..5e0ea83a9f7f 100644 > --- a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c > +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c > @@ -13,7 +13,6 @@ > #include > #include > #include > -#include > #include > > #include "mtk_mdp_comp.h" > @@ -57,13 +56,6 @@ int mtk_mdp_comp_power_on(struct mtk_mdp_comp *comp) > { > int status, err; > > - if (comp->larb_dev) { > - err = mtk_smi_larb_get(comp->larb_dev); > - if (err) > - dev_err(comp->dev, > - "failed to get larb, err %d.\n", err); > - } > - > err = pm_runtime_get_sync(comp->dev); > if (err < 0) { > dev_err(comp->dev, "failed to runtime get, err %d.\n", err); > @@ -146,9 +138,6 @@ void mtk_mdp_comp_clock_off(struct mtk_mdp_comp *comp) > continue; > clk_disable_unprepare(comp->clk[i]); > } > - > - if (comp->larb_dev) > - mtk_smi_larb_put(comp->larb_dev); > } > > /* > @@ -236,9 +225,6 @@ static const struct component_ops mtk_mdp_component_ops = { > > int mtk_mdp_comp_init(struct mtk_mdp_comp *comp, struct device *dev) > { > - struct device_node *larb_node; > - struct platform_device *larb_pdev; > - int ret; > int i; > struct device_node *node = dev->of_node; > enum mtk_mdp_comp_type comp_type = > @@ -252,8 +238,7 @@ int mtk_mdp_comp_init(struct mtk_mdp_comp *comp, struct device *dev) > if (IS_ERR(comp->clk[i])) { > if (PTR_ERR(comp->clk[i]) != -EPROBE_DEFER) > dev_err(dev, "Failed to get clock\n"); > - ret = PTR_ERR(comp->clk[i]); > - goto err; > + return PTR_ERR(comp->clk[i]); > } > > /* Only RDMA needs two clocks */ > @@ -261,36 +246,7 @@ int mtk_mdp_comp_init(struct mtk_mdp_comp *comp, struct device *dev) > break; > } > > - /* Only DMA capable components need the LARB property */ > - comp->larb_dev = NULL; > - if (comp_type != MTK_MDP_RDMA && > - comp_type != MTK_MDP_WDMA && > - comp_type != MTK_MDP_WROT) > - return 0; > - > - larb_node = of_parse_phandle(node, "mediatek,larb", 0); > - if (!larb_node) { > - dev_err(dev, > - "Missing mediadek,larb phandle in %pOF node\n", node); > - ret = -EINVAL; > - goto err; > - } > - > - larb_pdev = of_find_device_by_node(larb_node); > - if (!larb_pdev) { > - dev_warn(dev, "Waiting for larb device %pOF\n", larb_node); > - of_node_put(larb_node); > - ret = -EPROBE_DEFER; > - goto err; > - } > - of_node_put(larb_node); > - > - comp->larb_dev = &larb_pdev->dev; > - > return 0; > - > -err: > - return ret; > } > > static int mtk_mdp_comp_probe(struct platform_device *pdev) > diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h > index 5201c47f7baa..2bd229cc7eae 100644 > --- a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h > +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.h > @@ -11,13 +11,11 @@ > * struct mtk_mdp_comp - the MDP's function component data > * @node: list node to track sibing MDP components > * @clk: clocks required for component > - * @larb_dev: SMI device required for component > * @dev: component's device > */ > struct mtk_mdp_comp { > struct list_head node; > struct clk *clk[2]; > - struct device *larb_dev; > struct device *dev; > }; > > diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c > index e1fb39231248..be7d35b3e3ff 100644 > --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c > +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c > @@ -18,7 +18,6 @@ > #include > #include > #include > -#include > > #include "mtk_mdp_comp.h" > #include "mtk_mdp_core.h" >