Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp445416rwb; Fri, 4 Aug 2023 15:48:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFvuRU2qVEDfx4157yD/LlQlWIzxcgQEjp9XdBQRNFGzmRZ3sYr+BtSZBP/Mjmwh5YCnvu X-Received: by 2002:a05:6a21:3d85:b0:13e:aede:f380 with SMTP id bj5-20020a056a213d8500b0013eaedef380mr3091380pzc.34.1691189324601; Fri, 04 Aug 2023 15:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691189324; cv=none; d=google.com; s=arc-20160816; b=ZhsNNC6g+INFpFGSlnvXeHJf9Thqi9YCkNKDC4MwQavEZpM3+cfZkILTINP4ZHWJuP QbPCA7kUjurNY74E9WhE1pHGXb1jyVP7gsF291XPcP8J0AmT20PlOu1uiLEaKU48VeGR 5gGzT4ILzTF00P1fXD4R7+U7Y4ajMAOTz9t3ASinRl4flKInJb537GSjBCPquqvWZ6nq qt95wPmUEfciG6Q30LrTPmPfuZS0kk0TD9vUZZ6Gz8EiEyXseufMqXQPl7Vlez4AlQTE dnZ2TdHtdPmR5AgRJeIxcL7jg5kJP/cCPvrlEyZuifMHFlI03Iq766McbXHHgVVfRFMt +9pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Qj00refZhLuErTSKNSGUW/qZ75TMCYbmVyutlgVJHgQ=; fh=grOAo0lqkKWoQ9GTv8s/aRkzUgHNIAb9RLKFUDIVSMs=; b=QhGn/hOMncCIRdCKo/wP7Pl1E0hYgualCs8SS1zkPdWOJqaLPA3lqwt/XLdLHIUEII O2KK5dL5nqbw8+zw/r4KAomYuaXLUqyg6LBZ5ZLlemD2kokMrSyDnUsvMhUoKOuWAnbY L7wTqNkEzE9sYGo/yAN+Ug82HLpTzyolNjW4D1c8MXX2ezuOo/hhrrDJ7mcbEuMODCyd bE7Fmq58pLcZ29SEJ1UlSf+sIMOQvRvSZeox0EOG3DC/PXy2y+4N7t8/WTSorPZr3qnu syvEeeGsgGtGJVIeD8B9noqrkHYuvRx2VV6RhkoIpCqrlRJc4YRf2BxqFhJykZXe6RWi S/lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MO4H8yS+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dc13-20020a056a0035cd00b006871fa2ee53si2314903pfb.65.2023.08.04.15.48.23; Fri, 04 Aug 2023 15:48:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MO4H8yS+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230236AbjHDVE5 (ORCPT + 99 others); Fri, 4 Aug 2023 17:04:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbjHDVEx (ORCPT ); Fri, 4 Aug 2023 17:04:53 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 534A45255 for ; Fri, 4 Aug 2023 14:04:21 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fe4b95c371so5206535e9.1 for ; Fri, 04 Aug 2023 14:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691183057; x=1691787857; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Qj00refZhLuErTSKNSGUW/qZ75TMCYbmVyutlgVJHgQ=; b=MO4H8yS+K+Xm2FffRCOiWPEJvYNH7Yf7+h3x+U9xYZzfFgMmpZUQjWTjHfVrozc7h/ r1kIzVT+FkUPql+u9EMpPdrjjCTYY50SCKB075W4lYtmEMBBON6Mwe1fweQqDzZFhQKs TZLIqkK3tgJASIB/1nKvF4hVv68QZ2OHtPtMKeseCJa2IOV7/dsH0rXH/FGlxYGVpAwB B7TzAF8GYgSCieLZwqMmc5pGKF0wh96lIx4r/RpmDlZQgNaggzYGFNi/jB+ngNy2WXGp Zub3xDQbXD1LD2ZyCJ6NJ60UoLo8DKr/C7lBZLwJphAv6FfM3pm37PCChO9Fo+kRigSu wf1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691183057; x=1691787857; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qj00refZhLuErTSKNSGUW/qZ75TMCYbmVyutlgVJHgQ=; b=TabgBKjR5wkoIX0mxNbVdY6/eJ28Nq2/Zv7wZ0xiAQ2EtoFaKd3ivrVqnxtOjs/XjU fhLsj9vRafOwLaJ701Lz33A9e9yTncsOzdy/G6vKoTma5X7SRf+gIhiqZXHgTqaQsTST JzCwj9AqrfCpf2lv1T1L3uQX96W3xnxztTeZ2rbA2TyQz2SI6NMvrDautCC49xXT8g1v gGKZOFm6CeTVUx3FyMPABjdPZy3oD+eQfrVAPbvut7cddvjztbdnpCwMSh80J2RZUWLm 39f8ciChM0Hk/9p9du8flL8viyCa6gSyefQiIZW6WgPXEaWvDIkxOK4HTp0ERc0SK2tO 5QEA== X-Gm-Message-State: AOJu0YxPOiQzHVOV/Gqd+K6q1F02dVKd083R4t5DLVitf/tTWtIYKa5O 2bQoUs9XT3gKg+G9U6uETRt8qA== X-Received: by 2002:a05:600c:2609:b0:3fb:416d:7324 with SMTP id h9-20020a05600c260900b003fb416d7324mr617463wma.6.1691183056759; Fri, 04 Aug 2023 14:04:16 -0700 (PDT) Received: from [192.168.0.162] (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id l22-20020a7bc456000000b003fc06169ab3sm7556830wmi.20.2023.08.04.14.04.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Aug 2023 14:04:16 -0700 (PDT) Message-ID: <78d2fd56-804d-827b-d074-b139cf62a498@linaro.org> Date: Fri, 4 Aug 2023 22:04:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 4/6] media: platform: venus: Add optional LLCC path Content-Language: en-US To: Konrad Dybcio , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , Konrad Dybcio , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230731-topic-8280_venus-v1-0-8c8bbe1983a5@linaro.org> <20230731-topic-8280_venus-v1-4-8c8bbe1983a5@linaro.org> From: Bryan O'Donoghue In-Reply-To: <20230731-topic-8280_venus-v1-4-8c8bbe1983a5@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/08/2023 21:09, Konrad Dybcio wrote: > Some newer SoCs (such as SM8350) have a third interconnect path. Add > it and make it optional. > > Signed-off-by: Konrad Dybcio > --- > drivers/media/platform/qcom/venus/core.c | 19 +++++++++++++++++++ > drivers/media/platform/qcom/venus/core.h | 3 +++ > drivers/media/platform/qcom/venus/pm_helpers.c | 3 +++ > 3 files changed, 25 insertions(+) > > diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c > index 0af45faec247..db363061748f 100644 > --- a/drivers/media/platform/qcom/venus/core.c > +++ b/drivers/media/platform/qcom/venus/core.c > @@ -302,6 +302,15 @@ static int venus_probe(struct platform_device *pdev) > if (IS_ERR(core->cpucfg_path)) > return PTR_ERR(core->cpucfg_path); > > + core->llcc_path = devm_of_icc_get(dev, "video-llcc"); > + if (IS_ERR(core->llcc_path)) { > + /* LLCC path is optional */ > + if (PTR_ERR(core->llcc_path) == -ENODATA) > + core->llcc_path = NULL; > + else > + return PTR_ERR(core->llcc_path); > + } > + > core->irq = platform_get_irq(pdev, 0); > if (core->irq < 0) > return core->irq; > @@ -479,12 +488,18 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev) > if (ret) > goto err_cpucfg_path; > > + ret = icc_set_bw(core->llcc_path, 0, 0); > + if (ret) > + goto err_llcc_path; > + > ret = icc_set_bw(core->video_path, 0, 0); > if (ret) > goto err_video_path; > > return ret; > > +err_llcc_path: > + icc_set_bw(core->video_path, kbps_to_icc(20000), 0); > err_video_path: > icc_set_bw(core->cpucfg_path, kbps_to_icc(1000), 0); > err_cpucfg_path: > @@ -504,6 +519,10 @@ static __maybe_unused int venus_runtime_resume(struct device *dev) > if (ret) > return ret; > > + ret = icc_set_bw(core->llcc_path, kbps_to_icc(20000), 0); > + if (ret) > + return ret; > + I would scream if someone left me this comment but... In probe we have video_path = cpu_cfgpath = llc_path = suspend icc_set_bw(cpu_cfgpath,); icc_set_bw(llc_path,); icc_set_bw(video_path,); resume icc_set_bw(video_path,); icc_set_bw(llc_path,); icc_set_bw(cpu_cfgpath,); it would be nice to have probe match the ordering ... > ret = icc_set_bw(core->cpucfg_path, kbps_to_icc(1000), 0); > if (ret) > return ret; > diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h > index 2999c24392f5..45ed1551c2db 100644 > --- a/drivers/media/platform/qcom/venus/core.h > +++ b/drivers/media/platform/qcom/venus/core.h > @@ -65,6 +65,7 @@ struct venus_resources { > unsigned int bw_tbl_enc_size; > const struct bw_tbl *bw_tbl_dec; > unsigned int bw_tbl_dec_size; > + bool has_llcc_path; Why do you need this bool, you can get for llc_path == NULL --- bod