lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5c3f6747-86f6-3fe9-6dfa-edc44b53c0b1@quicinc.com>
Date: Fri, 5 Apr 2024 13:09:04 +0530
From: Dikshita Agarwal <quic_dikshita@...cinc.com>
To: Konrad Dybcio <konrad.dybcio@...aro.org>,
        Stanimir Varbanov
	<stanimir.k.varbanov@...il.com>,
        Vikash Garodia <quic_vgarodia@...cinc.com>,
        Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
        Andy Gross
	<agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        "Mauro Carvalho
 Chehab" <mchehab@...nel.org>,
        Philipp Zabel <p.zabel@...gutronix.de>
CC: Marijn Suijten <marijn.suijten@...ainline.org>,
        Stanimir Varbanov
	<stanimir.varbanov@...aro.org>,
        Mauro Carvalho Chehab
	<mchehab+huawei@...nel.org>,
        <linux-media@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 04/19] media: venus: core: Set OPP clkname in a common
 code path



On 3/27/2024 11:38 PM, Konrad Dybcio wrote:
> 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 <konrad.dybcio@...aro.org>
> ---
>  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 <linux/of.h>
>  #include <linux/of_platform.h>
>  #include <linux/platform_device.h>
> +#include <linux/pm_opp.h>
>  #include <linux/slab.h>
>  #include <linux/types.h>
>  #include <linux/pm_domain.h>
> @@ -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 cf91f50a33aa..ef4b0f0da36f 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;
> 
>
Reviewed-by: Dikshita Agarwal <quic_dikshita@...cinc.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ