From patchwork Fri Feb 9 21:09:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 771913 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 B0967168A7 for ; Fri, 9 Feb 2024 21:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512978; cv=none; b=Wz3DcosQkb1woYkoQgXl7jywQA0pnOl72Nxa28ECKdSjzqPSdVzwoVlqNtRMDAJts0zk/BNXBWP+NYXBPmLHgO4Jn09DqLLyUaWbxc9/Oc7U6rd7+7y7N/Y3xzAxFmmRB6VDZ7MECt9HGTZ8Y8J1fkSlCv/SlEQNMnudvAt9RxM= 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.41 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="diz0RxLJ" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a30f7c9574eso168013766b.0 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=lKbVfHixBvN1mJbNzEvj1ur61t+0vkcuaoMWdgf/712P91uosllI9TEwLd+GnLs7cX sid4LoEjA92OxcPVxu+VTrxqnUOJogmzu3b1SQDC8UZPCZjPWiBT+e5YrAT7AtQqsSjG Vyp4A+y285BaqU+hIQDHI985AJ/guuFwE/VRxiHj6MieCGC8TWVQxmTxcCHFqivjxSG/ uhKK86HoMdtYY6kLzQT3rgXMFMiBUVkLS8x8ins+DgJ31nc9bFNSym0Ov3duYzHiGq5A IZO2/KQUXKuamPqr3sl7OujhC2SUeVQ52N/2on+9J2yh1XCo4XIfemXJ1dIYj9idIVmT BRUQ== X-Forwarded-Encrypted: i=1; AJvYcCVyFNCaGQQvbCUq20uldZbzGUyYZa5u+Qg2rMFKhDgJwv3T61ubbsKka2D/X/02YJXAcVx02CGTtMH1JGMdOUp1AsWqpUCnlhUYWGI/hA== X-Gm-Message-State: AOJu0YzP5AbJjS2IE+lx+4srJ9iza/Re9DrEE22e+0f+YVzl2uFJtTID b64U1kI+//9k7Q1ZgTS7ALvXfFj8sr9B9H4FaOE/h1URYIep+7DZFH2Ean455g0= X-Google-Smtp-Source: AGHT+IGED20EuYrpVnsaQAht60P6B5x0FyZqdTMHIPCvsHAfOQfLEtwlg6QKs1bwugOpl8ZZaSiqyA== 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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; From patchwork Fri Feb 9 21:09:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 771365 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 7FDDA1805F for ; Fri, 9 Feb 2024 21:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512980; cv=none; b=HmKLYV7l5RLhCpAND1iKQv3SlMVXXKc0zxnhkzwcDOdWf6IC9J/Qhnx1VCUry7eVJXUu8uu+y3YoNqo4MeYsESwGyw9mUj9txQ0mbI/uV8mAliLJ4DH8xjwWtae/lyYdd/88gpNSl/of6SB0gG8z/m0xN0n1gvDFqElKinEShVA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512980; c=relaxed/simple; bh=4x/me5yeOEh7Kc0NCGCe3k/ewNhk7l+PTAXEKLbJtdg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EzuOEN7nk/yd4mN/465hHAEwU6Xt34HO1JPGs0nYvQAgR++jg8uykcDiJGVqsjej9A8XzsuspdFRBzTQ5C/4NJiN8rYFcHICSTD7EUUc+GJiozD8bxsAkL1h3/33DoqJSMOHWzdEj8WE7mAQBC7JlJq2nazBoUxAQUUuFEW1fJQ= 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=o5t7eATv; arc=none smtp.client-ip=209.85.208.46 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="o5t7eATv" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-55790581457so2229999a12.3 for ; Fri, 09 Feb 2024 13:09:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512977; x=1708117777; 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=clU3y8fBgJIxt4Cy2lqLbmum74KaZZM8VM+LPgiv+vQ=; b=o5t7eATvxhaZ/XquO4eAgkoflYx7zKCyysY2K4KKlDhoDBxv5BkuMmVN0Nq/OP4iko t8vHpJa/uryZ879JOxl7p9O29lG+fvMSB32am8vrEJB5c1br0PfGvM2UUHiRl3XmMYR1 IJ0JCWkNLtf6AfMRDMhL8gR5lW0tRorZgE9IGEez4+0qnWjhIHLd+NI6dqSUJdGMLmvs wedzs0Ph5A/UO1pkYaTiElwv4sdR/nnTuWj1z1bKidcUerhhUMFoRagr5W9Pd7/JMz1m T3eEJkID6ssLHTV03uS3/RAVpquWD79IHiJia3ZRBZDGmAT19PbzzhlkxgO+o+RjYctt JUrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512977; x=1708117777; 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=clU3y8fBgJIxt4Cy2lqLbmum74KaZZM8VM+LPgiv+vQ=; b=R/0C4Xo1MjrRRx2oU7cKOUOtFIu6GRTTw+xLijPtTBdIHdMJDk62XCfS0/fYHcpYZb V8TkOhdxPfmtTAjADBeeyyVnP0rexgebdq+8o6QiOgMEDVrz3YZNrCVwd38bouGpEUjv T5QLLgjOs2hFiydMsYU55TAolB+Lp8FEBbRjJ2Wnnp9bvAaNvo0Sh9RLWBbGL+1pHAZB kIYWTlv6tmB1FMkfTSgMEMZV9CmeS9tKa7OvoEkoxmair4B27Hc/jwelTNaac+roqdp7 N71oImNqGM37b7n5zYObtMBJyAUw0iAjJINBajv5aMlfd0XwCxF5Eil8SO7yOxQz2CbC 7yzw== X-Gm-Message-State: AOJu0YwG8eTbEN+JLCKN41B6sdGUoHGGq4hMoXarHeSKHsV7e3Ps36nm GmdY+78DEdoc6NgmWhmIumoAYHOrm4DxEvOToZGdaqIRYOxlODi1fR3lYube09c= X-Google-Smtp-Source: AGHT+IHzP+Vx814UZKik6txLthDwrUOGXXEAdY69dIQ5BK4YVYcz9T7m9182CwcJmk+k8CJWwZVKYA== X-Received: by 2002:a17:906:cf8b:b0:a30:8c7e:5f7e with SMTP id um11-20020a170906cf8b00b00a308c7e5f7emr180181ejb.28.1707512976771; Fri, 09 Feb 2024 13:09:36 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVwpQeaR0xOayGoUqOVl+6TXXrcArmTCNHHL34seMfomq81hBB0gbHB4UJ3DhbgmsHaCxbRpxYb9EiEQ94DeQXlgchLwv5IM0tzG2BNvpJwFHuZe19yFJfOGOA9fxuoDoh0+YJYomq99DAwc1hiplbcKYhvOcZw/8n/rpSRwZFOLF1Qj4VNL6tgvp5OX0CPqF6QYczqvoCocJfuk0OtOSbNkO1wqVQ62t3gB1eyDudxWqX3FDsKflAc5Iq1AU99q//UNQcHPJoRa1KLEtKY79aZ8zNVznmDoR0/D9J/VKUYxfna5N7xwvXVlnHHc61rNlYe25bG2VMc6jjbyAZQOyyE+sXXAavlKoxSJf5vAsSrdVDyIFTOaoE3Jod7OY78Lrhurg1xNHehtxEeOf4PS/iN+RgU4YJnQMakzhazxd4pPKe0YHlLC8Od8bHj3F9SfF3R2MJ8MpN8zhZo/wn/rAnXEx7fowRggbFLWdd0skbSiOzSmwrGz/xzbccj3+8LMD/7gw== 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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:36 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:23 +0100 Subject: [PATCH v2 02/20] media: venus: pm_helpers: Rename core_clks_get to venus_clks_get Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-2-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=1211; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=4x/me5yeOEh7Kc0NCGCe3k/ewNhk7l+PTAXEKLbJtdg=; b=ojT8QqLG5zLEf1+mc3VVpVe+vhkE85IzgZfrLRyhsivN4LN1enTJW5ID6qrPtpAPMrWFc94yi 9tWKxMksMSJDcaEVmxPgDTMQOf+vw8phD5WN5zD3vaFz0N49gR0QlZL X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= "core" is used in multiple contexts when talking about Venus, rename the function to save on confusion. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 8bd0ce4ce69d..ac7c83404c6e 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -23,7 +23,7 @@ static bool legacy_binding; -static int core_clks_get(struct venus_core *core) +static int venus_clks_get(struct venus_core *core) { const struct venus_resources *res = core->res; struct device *dev = core->dev; @@ -294,7 +294,7 @@ static int core_get_v1(struct venus_core *core) { int ret; - ret = core_clks_get(core); + ret = venus_clks_get(core); if (ret) return ret; @@ -961,7 +961,7 @@ static int core_get_v4(struct venus_core *core) const struct venus_resources *res = core->res; int ret; - ret = core_clks_get(core); + ret = venus_clks_get(core); if (ret) return ret; From patchwork Fri Feb 9 21:09:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 771912 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 3125B2110B for ; Fri, 9 Feb 2024 21:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512981; cv=none; b=sMQEujcu6ndBedOK8/uyvQ493K9lgsnDn7jiHsOSc0livoLrJFSKKvtwqZCrSSMEiUs2yRs5XrJ5gBvhB63GcKJ7Z9tHwidLEcFrX2bJnl/e030g7lZraGjlBloajQNfUqF63Lg5DpPZQt3Y1jBouXiZQsr3wXD0T+g4Z2YAB7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512981; c=relaxed/simple; bh=qRFNx2a0sPyBufJHjBf1XzrjeKK7bQ1fasBPqhqnRAw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZtZNO0XnbmeEUkVP0mNJ9eV/lGf+h2WUJMoD/7pEwTrkPCgTJi2sY1UAIStkv/rK5JzyJ7EA3cs/xuDQGWI8jGcxtqLJvrsbqmhsdYrAbOSgQrgNugRJ2vl2/liZ5fVESOgLN6MdZn1zympcYnQcYWc60SGupv701OLl/WoqyvI= 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=qck5GOuR; arc=none smtp.client-ip=209.85.208.43 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qck5GOuR" Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-55ee686b5d5so1986369a12.0 for ; Fri, 09 Feb 2024 13:09:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512978; x=1708117778; 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=3P4+a9/cIAslmQuzQjL8EtOxDSeXqHOG2MyxLu4mmL8=; b=qck5GOuR3v7ACRXwSkYFZmK0ooW94HNt19ZXEcbR9rpLxxIsU6openJ5OAZmwKmUy7 EicuUxMbLFCrpxukRK1MzQ/Xe73ActwdGTjb4tfvq+WHndyLOzE/PtgxWYYsLNiEu+Mz +xrnCgajQqf3otVi/hQc9KFzGY2u00mmE3gCU8dxAx2ZwlrJH3sTn+9u+mUANwGcdm1t 6k8sFAxzk6yvNJpE01YlkLRKesVrt7CkzLDdCrwqgdQzoMfTG/Ki86PxD26yCjrRGgCO Me28FHibNM/dtNAWEdnO67vPrYVvkdbejaIHTyI2aFvud74uCK3mDNgqIYjEMIjc9/ps 9dBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512978; x=1708117778; 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=3P4+a9/cIAslmQuzQjL8EtOxDSeXqHOG2MyxLu4mmL8=; b=tCK+usgTd7N+jgcnhRejg3lTeXVTT2yL75Hhb0VvwqKMIysGVdUJmuF5n/DFs8xoq+ NfQpjq0VkKfEyRvRT2j720IusnLAOLEGnTdIe9km57BZWOca0/wvwE0pGaZ7dQw7x4ol 5dMvVicN6bj19/qUMfEv2XYOjpH3L1tESEDW7nz4TJUh9IqsEUZjCsApxFDm6seaqXGz z95/OcU7Moje4rp1EqnGEaJfCYWiT/Ee9y7Ma3hVOq7yvwSTqMtu3TPrv0tDvMr3RG9Q WK7IRuxNnub1+X7FUGAdPx5xI6lRBueROAiZXdhozfnnKy5TLteKvTGLcmOYUJo3QZjc trqQ== X-Forwarded-Encrypted: i=1; AJvYcCUaBb2mqU0X0JZ6mi8EWWUk2DFD6eqv9IvDqU5/IWIOHlBqocjG+alTXxzauqxTcWCfLWGsjKPi1NLbeUmWqA3q7EPLu4D+BbAller1nQ== X-Gm-Message-State: AOJu0YwO+oUY2Hf4T7dCn9LiSM4WOHt8HihwNkr6JBC4zBx8L/MN6YLO evntucNWNtxiGv0rseIxiR1d3qxbsXWC4f6s0QDhve70TckPGVuI9Uw6xi1dmqA= X-Google-Smtp-Source: AGHT+IESvxpc8wJ0oVbIuXzOZddHwBQPHFV+gIPXIb3XIuwrUgQYewE9Hvo+UA3RRVD0H7Rz5otnbQ== X-Received: by 2002:a17:906:6d58:b0:a38:625d:8427 with SMTP id a24-20020a1709066d5800b00a38625d8427mr194776ejt.48.1707512978318; Fri, 09 Feb 2024 13:09:38 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWJzBiZ/TTNm2w+OuWjm83uhJhHA8Ipd+Wffmn6LnhvoVFE5HgaYuovGQ7mgVPPQR6P1xwM2+1PD59mUIS3eQvlefBk9G49se6W4Q3UAolQolIOI6nmOUiNfa1kw8dTh5xzKefk0zqR0kxlc+e5/KjUt/dKg0kqlWiFJ+CQG1xUMoJTKBTjzQZGjIAFNPDNvXSYAXHjo/azPZqHnZ8RJyzqNaKxAXuYPnubrhXx4Hv7Kr7FTNDaW34o1GniGbRPxkINOYeAW4wup9v2MO/PggIqaVTB69j5eAGECWj9NRPC9tSlPJEDODScssRtKDdzX4BBovewQvp3aNc0sGF54XeSyUe9wK2/TwNECPz+BSzSRnPaFlO5Fqwn7F2Eo0ihUszZ+m+9LQPJ9GQEYgD3bfbmJnIYxwxJ+fWPH6H1/JCzQCevpphR7dVb8rvNVNRvcMmWGixA91o3OTn/OwlZnnIERZw2fEQsTxTsUfkxPYisnOkKdHQgs8o3CxXzgVRVqN1PRQ== 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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:37 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:24 +0100 Subject: [PATCH v2 03/20] media: venus: pm_helpers: Add kerneldoc to venus_clks_get() Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-3-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=2105; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=qRFNx2a0sPyBufJHjBf1XzrjeKK7bQ1fasBPqhqnRAw=; b=ORx9bBusFVmbADK2rWtJUBcEaMKTPSaBtKJ/kovOv2DR5ZDBMzKXGN3q535RixmDVP9TEYxBo QkrgBcRH+GvD4lqAuzRy1vs/VU0i6gr+kYkXU9uaWRAASqggGyt6wIR X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= To make it easier to understand the various clock requirements within this driver, add kerneldoc to venus_clk_get() explaining the fluff. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index ac7c83404c6e..ea0a7d4601e2 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -23,6 +23,34 @@ static bool legacy_binding; +/** + * venus_clks_get() - Get Venus clocks that are not bound to a vcodec + * @core: A pointer to the venus core resource + * + * The Venus block (depending on the generation) can be split into a couple + * of clock domains: one for "main logic" and one for each video core (0-2pcs). + * + * MSM8916 (and possibly other HFIv1 users) only feature the "main logic" + * domain, so this function is the only kind if clk_get necessary there. + * + * MSM8996 (and other HFIv3 users) feature two video cores, with core0 being + * statically proclaimed a decoder and core1 an encoder, with both having + * their own clock domains. + * + * SDM845 features two video cores, each one of which may or may not be + * subdivided into 2 enc/dec threads. + * + * Other SoCs either feature a single video core (with its own clock domain) + * or 1 video core and 1 CVP (Computer Vision Processor) core. In both cases + * we treat it the same (CVP only happens to live near-by Venus on the SoC). + * + * Due to unfortunate developments in the past, we have to support bindings + * (MSM8996, SDM660, SDM845) that require specifying the clocks and + * power-domains associated with a video core domain in a bogus subnode, + * which means that additional fluff is necessary.. + * + * Return: 0 on success, negative errno on failure. + */ static int venus_clks_get(struct venus_core *core) { const struct venus_resources *res = core->res; From patchwork Fri Feb 9 21:09:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 771364 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 AA1772E646 for ; Fri, 9 Feb 2024 21:09:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512984; cv=none; b=BPJcsdN+7NBuyrzz1wclDgfVSkWVqJqMaKFtxX9qlrt14Vi0QQ00Gf/HLFPEQfvMazkDYU7TlvG/KR3MFuoUSENjCuh0RSnL0EaezqLGuzI4nCD8PBgrz+tKrgIwbSZYg/rsylHI5mr+/c0e/DEPt++lofAfIt3QrPZftoAG4Zo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512984; c=relaxed/simple; bh=y2JWZvHJdVFdS2JPzFc6K4lM3ffIwu7LSCAQM8cYwps=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MlJVKJcgDShwRnx4D0F8qD75AOHl9KG/ZdfTO/z0HFVGW+khPmn9h4HZDET5LhaORXiQtg2NF9wyydCM/y4XarXUEv0uW9VAzAGQoEV6e5QdV3LbU2OngSC6gGQ254vRJPN3yReFHgT7mEtT18uQlNqXy+5Ue3QcK+v5kiFSELY= 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=FjuCx022; arc=none smtp.client-ip=209.85.167.43 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FjuCx022" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-511531f03f6so1646096e87.0 for ; Fri, 09 Feb 2024 13:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512980; x=1708117780; 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=zHqRSPmMg9wEwP3rMANc1kfU5BrHC67r5uXE7Pbrcfw=; b=FjuCx0222QC2Z6NQf1NFj3A4yr/d/F6bPDQlORaxbthOvgxkjBwPxjNJAcLPrzic7m rCHVGiGyhRpnaaibWofHYhwbvIgZEkdxZ/VhdjVY+3zxGV0wdgYk6Qaw/G79/RbNCMGw LNwX0zfXOYjhfiz5hC354fbjR+7ooG1SQxLF2c2rgIvid3JGhv1WJKYlVcQbQzMlMazI APfAnHCtAf3r9Dq51tcEltbogOi3hnN9u81pgs3al3GLqSoA1k8fPrMXQRlx3cusbNLJ yl28ekJnCic1PXyuT563wR6MZUKHXPBdjvj7qENTFcwMAcM3Vier1PbTOMGFUH4npW/z YrRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512980; x=1708117780; 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=zHqRSPmMg9wEwP3rMANc1kfU5BrHC67r5uXE7Pbrcfw=; b=ogpJtbxuonWSEnBnou8Y8yrNR+3zuvLMeazfSf62ij3GEJr01DBjpfUjSyeZl7n42o 9KpTK8SWbI7M0xx0WeiXgwam7jFB8t+lQ2jp6F6E5OlNWPmLgDqfTE7CQtYgBDgtYBYw Z1MMC6w4cv0a042tnBZ0NqYdceB91PBWaj/olIaHZg5EenogpP4EJsMv8qs0KMhC3Vnb QmtdhDN+nz0KHlx6T3DZYwcPNxzl5bf6zMRQxrFw5OSsy0hEAdoOxKcDSTDDvvrv1tN5 oIm19rDuqwqqWCLlrqpqvfrjiCQvXaMwis/QJd1QlRvk2lmbnrhqIuLRlxfX57WWDQ/x ezmg== X-Forwarded-Encrypted: i=1; AJvYcCUM07qx35+RkplyIpqtzNhNpn5v1L3Cvxoatx4pI7pwYt2kq//vFSdeJhZmwUHcCU4jq/Vxi8eIn2/eb/I+uk0ByfuwyopHtBEFS4zLYQ== X-Gm-Message-State: AOJu0Yy95NvXo4jzR/uYlEKMxzN/XseBXIcoAWIhpxNXLkIa7njhSca2 4Vw3G4WMbSIz3w4IMJaAc8vjzzqdnihRWQ1Qs7Sr7zPB17Ng5yFAeqh92xXtKZc= X-Google-Smtp-Source: AGHT+IHKeFpvpCJszpvfDnW0xoJSU0+b+hb8GloxzgRp1+C0aN+PjLt8GIouHDl9EE5DZkh+imlmbQ== X-Received: by 2002:a05:6512:308e:b0:510:a0b:52e3 with SMTP id z14-20020a056512308e00b005100a0b52e3mr108452lfd.68.1707512979829; Fri, 09 Feb 2024 13:09:39 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVaRJINx/8wiN+GpFD3aVObJUom5I8zUiQqvAZ4XJQpGDoIz6sch5lV5joqsjlqVv83S5JlLbOAxLQCxaFkw2ZxAFRVF8SB3ysXQtTrLJorjZ+PPC0Ch2pevqTg/7mgq6H+YSEjJyMdJwc5PzCz1BG7eWwsGjZqKa0IB2V2hV1b26TeZpnen3vjkMvrUioBQgSGYMnuOznmVY7tgZLCkGM5hQihH+HoHgPx2jGZPnlrgO0BNsoyI5JOOrhfRvC/E6As1K6inCIsRm+yWvlVg9jUJLxcFoTCHPueZDZutrj5aR3EY9jg0ynLjYkr73QKVhrm7jkA4sBto1i2KP+7F59wWc6Jbi7OqdKQG1rnCXWwLfDNHlUemKxT15AmgEHTkijGEwIhni19Es/8qLXrGNRjbDP0Gy8n4oJCAJYRDXqGOlUy61CkNMX6Um188tMvY7WWSzhp9HSIQYPaHZhYnBikQzl8gE/cTqMXzwKkS5+g8m8ryKvzCRGsfu/+MiWmEkTGww== 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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:39 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:25 +0100 Subject: [PATCH v2 04/20] media: venus: core: Set OPP clkname in a common code path Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-4-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=2649; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=y2JWZvHJdVFdS2JPzFc6K4lM3ffIwu7LSCAQM8cYwps=; b=vqxjZLB2wKoZeA1sqxtFieFX/lmXor7OSCMGzaJ/ZLT8fJHwP+eUBcMnhStwX1NiWW8JecbfT V8HD/gEQuZKBNG5ojniHgOZ7IHd4sYDc3uhnMC5Um+DOPnB1f68hOqQ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Calling devm_pm_opp_set_clkname() is repeated for all HFI versions in pm_ops->core_power. Move it to the common codepath. This also lets us get rid of core_get_v1. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 5 +++++ drivers/media/platform/qcom/venus/pm_helpers.c | 23 ++--------------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index ce206b709754..5ab3c414ec0f 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -319,6 +320,10 @@ static int venus_probe(struct platform_device *pdev) if (!core->pm_ops) return -ENODEV; + ret = devm_pm_opp_set_clkname(dev, "core"); + if (ret) + return ret; + if (core->pm_ops->core_get) { ret = core->pm_ops->core_get(core); if (ret) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index ea0a7d4601e2..1ba65345a5e2 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -318,21 +318,6 @@ static int load_scale_v1(struct venus_inst *inst) return ret; } -static int core_get_v1(struct venus_core *core) -{ - int ret; - - ret = venus_clks_get(core); - if (ret) - return ret; - - ret = devm_pm_opp_set_clkname(core->dev, "core"); - if (ret) - return ret; - - return 0; -} - static void core_put_v1(struct venus_core *core) { } @@ -350,7 +335,7 @@ static int core_power_v1(struct venus_core *core, int on) } static const struct venus_pm_ops pm_ops_v1 = { - .core_get = core_get_v1, + .core_get = venus_clks_get, .core_put = core_put_v1, .core_power = core_power_v1, .load_scale = load_scale_v1, @@ -423,7 +408,7 @@ static int venc_power_v3(struct device *dev, int on) } static const struct venus_pm_ops pm_ops_v3 = { - .core_get = core_get_v1, + .core_get = venus_clks_get, .core_put = core_put_v1, .core_power = core_power_v1, .vdec_get = vdec_get_v3, @@ -1013,10 +998,6 @@ static int core_get_v4(struct venus_core *core) if (legacy_binding) return 0; - ret = devm_pm_opp_set_clkname(dev, "core"); - if (ret) - return ret; - ret = vcodec_domains_get(core); if (ret) return ret; From patchwork Fri Feb 9 21:09:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 771911 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 18B2937149 for ; Fri, 9 Feb 2024 21:09:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512984; cv=none; b=pFR6tY5i2ikaJDDJHvWKVvsysUHet2jDqMR7NfA7ljXfEo0YQtAkxhV9eHbVT8AaCcXvhQXCNCXwDbrqiFmuZZ2YbX7spNxXfVnh1017tvisBOLqkPyWEvZQR8K7f353emRTClCR9NK2aNHW4lRqYmjfrGaxLPP7krEPMtrTaSE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707512984; c=relaxed/simple; bh=3dtrntbOogwjknLFZqca+wBqcS9QWbQOd9iEEJQfOvA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K4xie+nhftRiqFkOn8CCWBLOgOxvYeNdKPGBKmxSn+edW2iCQJutvlTLk7FwTrk89Mbjc87vjGpFZlKm2X+9SX+M0jxwJ+LuEC1F0MnBXgVu4I12cF+ICgh7wBkNxg1sdjQIG6vNhoOZuQuGpc//xLFQn56HwlxCcyCOa0bvSCA= 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=jeQTS7zH; arc=none smtp.client-ip=209.85.208.44 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jeQTS7zH" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5600d950442so1695521a12.1 for ; Fri, 09 Feb 2024 13:09:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707512981; x=1708117781; 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=AK+SsOpDJXwjdmEkPZAy2mx09ivoS/IARlVKsNVFoYA=; b=jeQTS7zHWPv38FopjG+9xEU7NXUJTRnWiMmMtBlWShKAwVVWJo/v+f5OG+u6zr0PNv AKI0SiJnfQEDHSizuZNKZmgVUnUPKObzI1Lj+n04LfAtQVLL85H/d4jNIJxNM+M7gWsj nOpN/5kbUpnUGG2/ZBJmC7g+ecKXbXHp0jbQ5mkPR6/QzJl/cOeCl2CS/cz1XVoien/M nuihrMoR3wUQt+MHZaBys3hZR+83Z8DS1zc9pZm9AdA4/PCQsaYzhPm6tQwouYnEyeUX fVL7xU9gbGft5RsqZaYKzPjRRZFqrKtxuiHkPbw/1x+VCAJIi3RVpxWrLgjnzwe7UdQM GYrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707512981; x=1708117781; 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=AK+SsOpDJXwjdmEkPZAy2mx09ivoS/IARlVKsNVFoYA=; b=icGu79pFzd3AMtGZ2LveAEtSyNasLE3RDD38bxthib2jhCFGCtiJnDPvBcCvu+pmj1 GVDJ11/hhBSI7VhB5bznrTMU+TwiSNCmlT6KDb9acyGC4dbk1ggZR7JOSRmXwnbq3alT wSQecJYPEBsTvKs0nCYpulMVjSzE5z1f42ZP98NZ//XSW+kOn4IyFTfRchoEU7YlYmxx muH/8uCWJYFGLC503dfLevjXgBQh5aeecYJonfVVeojFMqfhh3z3dvLrvv8hkLipNhXt 5Ss+MkUwmZ/LKZGGI8SeEb6qSsNK99usAAGQNNBGGZCWPojXkJtoV8GF2cIJztcjYJI9 PXwA== X-Forwarded-Encrypted: i=1; AJvYcCWWLZrnadX4uGIAPr5lvxqDEa6ktJNwahdrSOYAj2sLm0IiqK6wJlVEqe4nT0fR4NobN9lUtXUwx4n+nwlQoICM6SOGE0zLSw2GQwDqWw== X-Gm-Message-State: AOJu0Yybmilxv9VqZ60zEBJHoMK8isj+xokpMFe+qZcnhAyRb+G9RSFL nj7RDUhOJOr8udFj3JMpxbCapZhQuE8li4CLJ5/N2q92WP6DPPvprrCiKV2q85g= X-Google-Smtp-Source: AGHT+IGmfZtnTZIBlUrbT3fuej5FpmCrMGimcOsSa8hOCIdSo3pqehnzc0VUDzvdrwtLzsrv9pDwdw== X-Received: by 2002:a17:906:f857:b0:a38:9623:7d42 with SMTP id ks23-20020a170906f85700b00a3896237d42mr241809ejb.14.1707512981437; Fri, 09 Feb 2024 13:09:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXeIK/Uo211/Ztmg10f505GpkvgNc6F3KNIEaUOa0+sXCI7QQmSxzjhJFx9UQGPCy1O0Xktwt4Fyzk/RtnrcP9r23Pm6NR3QFVAqEeTtIOfYRaGUbJdLRJbGKSbBLNhdMJDeP2iOR8k8Vx4ivqHcil67j79CS18mt9hv9aYP71EK9dviZd67QkyUzdbrXVRxWXf/YkMmUdAHAogG8rk9LwfpbaIaBudwp/taafrz11AIRiI2tw2w/yhCUg58t9PjW5q+CFyIsmtj3y3j9mdh1O5SGhRMcCS74uhg26sxf+agKV4PoRx2Hwoz55ovDAJtxmLcFjySYdy9PpPVsddz255uoWvCu2YFqtLqgraCKx2Y3s2UB0zhGOVU4s9MhXIYXuq820KUvVeR1qe26P4/TCtoHOxeeIbOl6+i6wf83iD9YZgBtyMKvuNkMDlP+sF8+tQ42kag397A9OlLkT0p2dlOr0YMIsbDbsJTlTfLqOJPx8vdo3NIwTVMxvUlYLtOnwPSA== 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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:09:41 -0800 (PST) From: Konrad Dybcio Date: Fri, 09 Feb 2024 22:09:26 +0100 Subject: [PATCH v2 05/20] media: venus: pm_helpers: Kill dead code Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230911-topic-mars-v2-5-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=1555; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3dtrntbOogwjknLFZqca+wBqcS9QWbQOd9iEEJQfOvA=; b=MvZNyCayLpQ1eIqz3XUVZ9mwJU8luMw6v0iR3z8H9iZIfFa4j1t1dj3qCHyw62OM9lh70rmwU PItjvQKkgcIAaCHrnrwcrpNj9Syd5Oj0llgBrrzy7OK6uSJYxEJ2d/k X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= A situation like: if (!foo) goto bar; for (i = 0; i < foo; i++) ...1... bar: ...2... is totally identical to: for (i = 0; i < 0; i++) // === if (0) ...1... ...2... Get rid of such boilerplate. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/pm_helpers.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 1ba65345a5e2..7193075e8c04 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -878,14 +878,10 @@ static int vcodec_domains_get(struct venus_core *core) .pd_flags = PD_FLAG_NO_DEV_LINK, }; - if (!res->vcodec_pmdomains_num) - goto skip_pmdomains; - ret = dev_pm_domain_attach_list(dev, &vcodec_data, &core->pmdomains); if (ret < 0) return ret; -skip_pmdomains: if (!core->res->opp_pmdomain) return 0; @@ -928,9 +924,6 @@ static int core_resets_reset(struct venus_core *core) unsigned int i; int ret; - if (!res->resets_num) - return 0; - for (i = 0; i < res->resets_num; i++) { ret = reset_control_assert(core->resets[i]); if (ret) @@ -953,9 +946,6 @@ static int core_resets_get(struct venus_core *core) unsigned int i; int ret; - if (!res->resets_num) - return 0; - for (i = 0; i < res->resets_num; i++) { core->resets[i] = devm_reset_control_get_exclusive(dev, res->resets[i]);