Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1188999rdb; Fri, 9 Feb 2024 13:11:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU84+rvwyhvHtA4CwlAomQ6Efy+dL8aFbEFyibxxgsuiMFlfSxyNyeqSYaiSykErm48OdA7pV9g6oeOfsSqiy1n25zBQAlGAHn6umbRsQ== X-Google-Smtp-Source: AGHT+IG1Zesse3Sy84c5S81Fp7HpD4kVv5Hi+NXSaTK/3TGLFkdJe8f3wsGM2TrGNvibjPDZtknE X-Received: by 2002:a05:6359:4129:b0:176:5d73:34ef with SMTP id kh41-20020a056359412900b001765d7334efmr611927rwc.24.1707513066034; Fri, 09 Feb 2024 13:11:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513065; cv=pass; d=google.com; s=arc-20160816; b=BshotjBAgnm5bdi0VPBfKzgxaznB4FQ1030QiZ2EWB8nFsnv6aDUoO3Qc22hJ6LCy6 FpStaKLfZDLnMyX8vRiZPK1wGv6fnvR2SkUw20KQ9vkfVXBpM0hi7idxisjiGecGlTN3 qEVD9WdHUri7bdbkd3CUCgYjSWpgViA3E4SYRHsblRuV4qa/F797flBSDQjdu6lyakKb qdQ+NuYhNQNDuGPw7Sj0ocwWi7ewvhcA/0FP4NBZocoHfAcp/8aI9fwloeX/qcwps5/f DMe9XGCa0+BYXAmAdySY9H1AonFy8/+6/6K7LjHk1t6rLborz5ty6tB0U62Y7DoGGXgZ MoCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=YqgwRixA6ApDI8sPrNg91MKVrvVSPJRcKUUS08MgCmY=; fh=womn5rfl8/nNhU1El3CSLTMG9PzzrJQ/8d/PvoOGOR0=; b=NmRgTguQpqd3mj6c+VxLc8QkA+foJZjIud4YvXx14zPs5zlD0/cObqS2V+Yay3eQr5 G+/HUeHKGPZnI5SjSUCyf2VEE63ktld6FcOEV5ckuIvVqVP5DIjzHIFEjkZ+T9lIabDl 7fWTl+Y5Xe7gDI7TBQ1yDnVf0TewDTfZk/6EnMxWixCZ4Nl3D+7XEmb1zX5yRFR846BA ZJCXLRY0KzF6RYxaEv3BKbOMQ73LZ4qYR35SJbHQAop6ndN0ptVtdGY9S1FeQFht9FeQ zeLj/D3RMTMhIrDlsRkLpVcFc9Ded6GdsIBu14D55PHF8W9c5FM26Fpvb/4wlnS9Ujk7 ergw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=diz0RxLJ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-59985-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCUxhtQLERQiKBoOhd74W7nbQon89WUaVeK5SEDvKy3omhXXUg/SzDjgPtyqeDO73FDS2gQRPePNNe+zKJt9TBGAUoPmjZLbJKVSOVtxzA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id du17-20020a056a002b5100b006de1e26adb5si874721pfb.275.2024.02.09.13.11.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:11:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59985-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=diz0RxLJ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-59985-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5185528BEE9 for ; Fri, 9 Feb 2024 21:09:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5484B1B942; Fri, 9 Feb 2024 21:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="diz0RxLJ" Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6FA3168C2 for ; Fri, 9 Feb 2024 21:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512978; cv=none; b=EAtG9l7FpknUokEQku8lvWn+GfUNwQ2tV5WOWOapU8zxmUNTJn+Urj7OAX0TY26qiMimF9fIs+qbQ6gPucuCaqrHYwe8N82wtvzpbQGnbsvF6yoi8RUTolo7BftOVhtuiAjDQCtd3/aUv36KexC3CMRzvy67AwEDCe9MwARPCUw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512978; c=relaxed/simple; bh=lb27xhI4gdBF4UHcwKFr8ScxLgxp1+CafppHA2L6fhU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BflPaacAootXP3KAvr2XLDp77/pyGIR8aLnJ9RbLEjzb5pH2mmkQlSMCZHRu1FGEZvXwFOB4PYpi1flz+5kP00Bg2uSX2RaBtFtnNJNwd/azw5xXz4EN6H1IZ4ndqJvf9k/dZqrJF8M3MI/Gf0sMp4wBZK2k7Cl1cxDJB/q62FA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=diz0RxLJ; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a26ed1e05c7so186222966b.2 for ; Fri, 09 Feb 2024 13:09:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512975; x=1708117775; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YqgwRixA6ApDI8sPrNg91MKVrvVSPJRcKUUS08MgCmY=; b=diz0RxLJzazmqTqNIGo7qY4VFqslspNbVO+20rQCIPYd2VKpI7pGD4ukE735U8NLzu QAAEojlQx7AAChqHczIA35fL+zQbDCMOsOpDjkpT4HNBwsRSp7Kckzk/3IzKjjJwD50O JzWvsQYN/fsvixg3gITcV8DzlzyMAtOXt3swy3rRVM7mJsLkkRuofjGI06XuNIHF74yi JeoFEEnnKJYsroYDzIGuWkhgILSi/3c+1AVOtN9lL6weMdxDk3fMuzoW9z8LWQs9STJM zYxSkrPRbPGAKG1wFyoexAN136xFVlBt2iuKeCehvwtbJqDT32/q4j221Jlpwzz/6EJ/ K+UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512975; x=1708117775; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YqgwRixA6ApDI8sPrNg91MKVrvVSPJRcKUUS08MgCmY=; b=BnqVV1xzsuW6wN+zFeBp7Gy8+E0YGNThHJTTj0rVXh+l+buPrZ3/p9rHXPmGDKyUlL N2sH4Dr3rkoJUIjalwvcwkG0M/MVf2cgDxwvrlWpLPYHYzElr/IuqbRW4zIaAoKrrEug L6QG+E3OJ8d9NSI0sWD5fAjZM2jLZxW6F0AgadeKV9zRnr/AlTuwhrEYmJE7/eLWS7mG Yi3MWK9b2SORV79Uls0cxbOo1H29TbT/qcRf5/RbamDoZ7xxhtGIBPJY7EUhGUAsJjIv pZ3dhaV85BCuuJM+VEGLSFYkrTjIrXqPFBOCXVZv1cMSyvgF1mXqLy+jMau+KNtsLnpw 1HtQ== X-Forwarded-Encrypted: i=1; AJvYcCUcIk65HaXLgFX96XqKXXywM2vdLi8VxhXNKegR+LSOn0obnM997FKWDPglQ/8eKM2CDNJbqhlz2p+XLKVbsoVAUxERRP++PuUCjm9B X-Gm-Message-State: AOJu0YwQpSKkkKlPedIqZGrCY2bSqmtfJExkzn9BoHhBdreFaDjCnrZm Mj+9yOKbU196eNJE8KCGmjj2MQk7s5tUatFlyrP3+dJl50MLvv0XHD1pXGW1zCE= X-Received: by 2002:a17:906:718e:b0:a38:66ef:14d3 with SMTP id h14-20020a170906718e00b00a3866ef14d3mr185447ejk.13.1707512975165; Fri, 09 Feb 2024 13:09:35 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWTpvx9yM7mnErFtcDnUGDjP2VK//6k7DMnglmnFSfOgK97aAHSUofzQz3YO5rJnGrWRPsvAJoH3/eSqzs70LjH+cuGqtUvaOqZnd8UU+4KJITo0L/N96XfZxBVXqg2Ep+fXVg+6+SBfMihCI/DwhrCvo/VBwoC7MzfVnhMvV+2XgVlEDr+b6w8/+4gTU6ELNLADSa8UQy8p2weJx0s8oRI9IFkrXbloI7xVaB4df+m+eeMz/BOOjY/8hmjOpg6sruukekjDAPzjttEzFzzI/gyKtDekl/QJFPZISI0x8kyT5n4bWyzXWymyPw+UaCu+5OHxgC8WGItMzkxRbhTvPeb9Q8RhrMV48hDEFV2mxL1wsAi/juBFlF6YRPswUcvqw8c7kqlew71t9xrJXGuIV/HyXKzYOWI4vEIZuAR6qAkzUox/9bRK80vZz2FiJOAzBD8aKA0rI+f6MeU51PsXKyW0HqjOy1n2tZKv6LwNssgwB6dgReiHSHfFYjtjgDEx64rjA== Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id cw3-20020a170907160300b00a381ca0e589sm1108516ejd.22.2024.02.09.13.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:34 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:22 +0100 Subject: [PATCH v2 01/20] media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230911-topic-mars-v2-1-fa090d7f1b91@linaro.org> References: <20230911-topic-mars-v2-0-fa090d7f1b91@linaro.org> In-Reply-To: <20230911-topic-mars-v2-0-fa090d7f1b91@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Philipp Zabel Cc: Marijn Suijten , Stanimir Varbanov , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707512970; l=1871; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=lb27xhI4gdBF4UHcwKFr8ScxLgxp1+CafppHA2L6fhU=; b=BYvxPbfQJO7lZPWc2Cb1EyRuJYBoAGwkeSywbuVSkwUn87PLDSMt/XU4H0pRNhwd6qD+yw/lD VK47K5Ow3XpDISNmeEH1vufGckVWwM9QPOQHOXKTn0E10ZcSJM+i/bf X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Commit c22b1a29497c ("media: venus: core,pm: Vote for min clk freq during venus boot") intended to up the rate of the Venus core clock from the XO minimum to something more reasonable, based on the per- SoC frequency table. Unfortunately, it ended up calling set_rate with that same argument on all clocks in res->clks. Fix that using the OPP API. Fixes: c22b1a29497c ("media: venus: core,pm: Vote for min clk freq during venus boot") Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 502822059498..8bd0ce4ce69d 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -41,24 +41,23 @@ static int core_clks_get(struct venus_core *core) static int core_clks_enable(struct venus_core *core) { const struct venus_resources *res = core->res; - const struct freq_tbl *freq_tbl = core->res->freq_tbl; - unsigned int freq_tbl_size = core->res->freq_tbl_size; - unsigned long freq; + struct dev_pm_opp *opp; + unsigned long freq = 0; unsigned int i; int ret; - if (!freq_tbl) - return -EINVAL; + if (core->has_opp_table) { + opp = dev_pm_opp_find_freq_ceil(core->dev, &freq); + if (IS_ERR(opp)) + return PTR_ERR(opp); + dev_pm_opp_put(opp); - freq = freq_tbl[freq_tbl_size - 1].freq; + ret = dev_pm_opp_set_rate(core->dev, freq); + if (ret) + return ret; + } for (i = 0; i < res->clks_num; i++) { - if (IS_V6(core)) { - ret = clk_set_rate(core->clks[i], freq); - if (ret) - goto err; - } - ret = clk_prepare_enable(core->clks[i]); if (ret) goto err; -- 2.43.0