Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp307555pxj; Thu, 10 Jun 2021 00:56:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzanq1GNZyG+TLJNWSrWS9OlxfqfKfoFLlWUoq73kZE/Tps1RBc7+M+SHHlTa4+bgwmIV7L X-Received: by 2002:a17:906:e2d3:: with SMTP id gr19mr3157586ejb.525.1623311786304; Thu, 10 Jun 2021 00:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623311786; cv=none; d=google.com; s=arc-20160816; b=aXgQ+VNWoK22N4VITs3F3Y+NyZ9cuEZHXIN8RvCBHuoA/Q6Nkm1p3w3dXZufuneMXG G3csoWI1i6wNbdqK6MWScCAW+T0p0ljxvZ+YAW3+Ofqenhzi6teU55tXDvt7kxECX/h6 y9XD7XDRUHHD6HAWjJynBVI9MR+Jrn1LhEXVHRsUvikiCdmVoSXNgEXIlcUp9q/ZVsx6 ekifPge1rwGuEJHe4SgY/alVwDBxUg00iIWHn7NxzQZO5r70sg2DQDK8AmttBelvPwS3 FPj/lei84NydQ0sYhpYOYSb41xhQffNz8V10YMnAwiBBHLBiAYm8L/7mSUtu8B68edZM zFzQ== 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:subject:from :references:cc:to:dkim-signature; bh=xJS0U9ByX0NxIuJpqaNPHe7gI5LppZzf1YoFLwdpgpQ=; b=H6enhV/fSeH5zGCNAdMokfhXCxJkkQJbn648QaiJ3uuRLWG7W+KG72CT+elGrl9Hj8 YEWtmRNymddRZKK8DAAxX0suHB+5gPcC2PYTw4CO8SFdzAaAlC21N+hku5YLin7cVaAa 4zzdJnFHDjbqk/k4J9IzO9lClAj7Jc8gG6AxghJmvt3JnnHKyI/Znwab4LSVJyveM773 dZTJBRtVYYyfcsQikdKnMDurHzSuJ/26mB7n2QD4k0iYOvkt43JNu7y3i6SZYMlVkQA2 YVgQj7Q7MEAtp8gRM9owVzi/VKh40Dgi0+iHzOr6BXCaWgGmt5khJap4hGsh3A+5rWI7 bz8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AtutUx5F; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 19si1849926edw.341.2021.06.10.00.56.02; Thu, 10 Jun 2021 00:56:26 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AtutUx5F; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbhFJH4q (ORCPT + 99 others); Thu, 10 Jun 2021 03:56:46 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:38455 "EHLO mail-wr1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbhFJH4q (ORCPT ); Thu, 10 Jun 2021 03:56:46 -0400 Received: by mail-wr1-f43.google.com with SMTP id c9so1102128wrt.5; Thu, 10 Jun 2021 00:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xJS0U9ByX0NxIuJpqaNPHe7gI5LppZzf1YoFLwdpgpQ=; b=AtutUx5F3FjGQHEtvWof9HOeTHWeBqvhVw+QiN+Sh6cWWewDfrjuaZjOgIU8GrvZla 6PSpE270aJ7Btt2qATsv9ZhQy58/0GoWWD5CnAISW5h2u03IY721oe03cmG/VhveVGw/ fIvFr3ZW60yd5JvkbVc401CsPLw/sMlHMPcEsS7+8fpbgaPGboXiVI4p2aQC0iupWWUA yvllp02g0KpE38Gh0/adERukIXbEQPWpkg5Hwp0/YamaLVTu8RR0KbFJ4rBVKtlUE2CD YXQcYwiWadJ1e0HyfnyVp6gQIJJRAngE/XVLL6ga9zNZL97Pp6Vg5oRaiPOGaMV825g7 /9Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xJS0U9ByX0NxIuJpqaNPHe7gI5LppZzf1YoFLwdpgpQ=; b=MXmy/UIVhsyRGp7eNgLaYOWvxyvTuIWmJh9VQZKPJhXb3cjmCZ3hcr3QEU6etqA8aA uz8gGcrGu1ExM4R0xSYsRv28qBwHkUAjJfDCtyCKqmcFPPRYQA6BiLEt9Gz3eVolY+ab /yvmeZzis59wB8ix+TOBk3wtZFhqc0dja0D7V4muh7ySou9K2VpKsysPmNfv1+qknzOC //3mMR7KoEMXYwIqAdxjNiWnFniEHT2cIM1zHOi4vzvWRsXNWgcsZq78veVQFT07RiP+ jziMF0iek9Jp/N+Z1Yx4Ktgx06dqmamddLE+yE1FLEtkxP+/Qup8plDeD7gg+XQ+m145 kPwg== X-Gm-Message-State: AOAM531Yvp5gYxjUlnSZtoCA0XoksyF+jGPUUJzjXv8YhAMIpkld5jO7 lLjkmxzqBGzuW0jyZECb4gI= X-Received: by 2002:a5d:6082:: with SMTP id w2mr3851640wrt.209.1623311615564; Thu, 10 Jun 2021 00:53:35 -0700 (PDT) Received: from ziggy.stardust ([213.195.126.134]) by smtp.gmail.com with ESMTPSA id o6sm2696870wre.73.2021.06.10.00.53.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Jun 2021 00:53:34 -0700 (PDT) To: Yong Wu , Hsin-Yi Wang Cc: Joerg Roedel , Rob Herring , Krzysztof Kozlowski , Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , "moderated list:ARM/Mediatek SoC support" , srv_heupstream@mediatek.com, Devicetree List , lkml , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , iommu@lists.linux-foundation.org, youlin.pei@mediatek.com, Nicolas Boichat , Matthias Kaehlcke , anan.sun@mediatek.com, chao.hao@mediatek.com, ming-fan.chen@mediatek.com, yi.kuo@mediatek.com, eizan@chromium.org, Alexandre Courbot , Tiffany Lin , Irui Wang References: <20210410091128.31823-1-yong.wu@mediatek.com> <20210410091128.31823-14-yong.wu@mediatek.com> <1620822547.2983.8.camel@mhfsdcap03> From: Matthias Brugger Subject: Re: [PATCH v5 13/16] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put Message-ID: Date: Thu, 10 Jun 2021 09:53:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <1620822547.2983.8.camel@mhfsdcap03> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yong, On 12/05/2021 14:29, Yong Wu wrote: > On Wed, 2021-05-12 at 17:20 +0800, Hsin-Yi Wang wrote: >> On Sat, Apr 10, 2021 at 5:14 PM 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 >>> CC: Irui Wang >>> Signed-off-by: Yong Wu >>> Reviewed-by: Evan Green >>> Acked-by: Tiffany Lin >>> --- >>> .../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 | 46 ++----------------- >>> 4 files changed, 10 insertions(+), 77 deletions(-) > > [...] > >>> @@ -108,13 +80,6 @@ void mtk_vcodec_enc_clock_on(struct mtk_vcodec_pm *pm) >>> } >>> } >>> >>> - ret = mtk_smi_larb_get(pm->larbvenc); >>> - if (ret) { >>> - mtk_v4l2_err("mtk_smi_larb_get larb3 fail %d", ret); >>> - goto clkerr; >>> - } >>> - return; >> >> You can't delete the return; here, otherwise vcodec_clk will be turned >> off immediately after they are turned on. > > Thanks very much for your review. > > Sorry for this. You are quite right. > > I checked this, it was introduced in v4 when I rebase the code. I will > fix it in next time. > Please also make sure that you add all maintainers. I realized that at least for the media/platform drivers we miss the maintainer and the corresponding mailing list. This is especially important in this series, as it spans several subsystems. Thanks a lot, Matthias >> >>> - >>> clkerr: >>> for (i -= 1; i >= 0; i--) >>> clk_disable_unprepare(enc_clk->clk_info[i].vcodec_clk); >>> @@ -125,7 +90,6 @@ void mtk_vcodec_enc_clock_off(struct mtk_vcodec_pm *pm) >>> struct mtk_vcodec_clk *enc_clk = &pm->venc_clk; >>> int i = 0; >>> >>> - mtk_smi_larb_put(pm->larbvenc); >>> for (i = enc_clk->clk_num - 1; i >= 0; i--) >>> clk_disable_unprepare(enc_clk->clk_info[i].vcodec_clk); >>> } >>> -- >>> 2.18.0 >>> >