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] [day] [month] [year] [list]
Date:   Fri, 8 Jul 2022 04:29:54 +0900
From:   Chanwoo Choi <cwchoi00@...il.com>
To:     Viresh Kumar <viresh.kumar@...aro.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        MyungJoo Ham <myungjoo.ham@...sung.com>,
        Kyungmin Park <kyungmin.park@...sung.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Nishanth Menon <nm@...com>, Stephen Boyd <sboyd@...nel.org>
Cc:     linux-pm@...r.kernel.org,
        Vincent Guittot <vincent.guittot@...aro.org>,
        linux-kernel@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH V3 10/20] OPP: Migrate set-regulators API to use
 set-config helpers

On 22. 7. 4. 21:07, Viresh Kumar wrote:
> Now that we have a central API to handle all OPP table configurations,
> migrate the set-regulators family of helpers to use the new
> infrastructure.
> 
> The return type and parameter to the APIs change a bit due to this,
> update the current users as well in the same commit in order to avoid
> breaking builds.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> ---
>  drivers/cpufreq/cpufreq-dt.c | 12 ++---
>  drivers/devfreq/exynos-bus.c | 19 +++-----
>  drivers/opp/core.c           | 91 ++++++++----------------------------
>  include/linux/pm_opp.h       | 44 ++++++++++-------
>  4 files changed, 60 insertions(+), 106 deletions(-)
> 

(snip)

> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index 541baff93ee8..d1235242367f 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -33,7 +33,7 @@ struct exynos_bus {
>  
>  	unsigned long curr_freq;
>  
> -	struct opp_table *opp_table;
> +	int opp_token;
>  	struct clk *clk;
>  	unsigned int ratio;
>  };
> @@ -161,8 +161,7 @@ static void exynos_bus_exit(struct device *dev)
>  
>  	dev_pm_opp_of_remove_table(dev);
>  	clk_disable_unprepare(bus->clk);
> -	dev_pm_opp_put_regulators(bus->opp_table);
> -	bus->opp_table = NULL;
> +	dev_pm_opp_put_regulators(bus->opp_token);
>  }
>  
>  static void exynos_bus_passive_exit(struct device *dev)
> @@ -179,18 +178,16 @@ static int exynos_bus_parent_parse_of(struct device_node *np,
>  					struct exynos_bus *bus)
>  {
>  	struct device *dev = bus->dev;
> -	struct opp_table *opp_table;
>  	const char *supplies[] = { "vdd", NULL };
>  	int i, ret, count, size;
>  
> -	opp_table = dev_pm_opp_set_regulators(dev, supplies);
> -	if (IS_ERR(opp_table)) {
> -		ret = PTR_ERR(opp_table);
> +	ret = dev_pm_opp_set_regulators(dev, supplies);
> +	if (ret < 0) {
>  		dev_err(dev, "failed to set regulators %d\n", ret);
>  		return ret;
>  	}
>  
> -	bus->opp_table = opp_table;
> +	bus->opp_token = ret;
>  
>  	/*
>  	 * Get the devfreq-event devices to get the current utilization of
> @@ -236,8 +233,7 @@ static int exynos_bus_parent_parse_of(struct device_node *np,
>  	return 0;
>  
>  err_regulator:
> -	dev_pm_opp_put_regulators(bus->opp_table);
> -	bus->opp_table = NULL;
> +	dev_pm_opp_put_regulators(bus->opp_token);
>  
>  	return ret;
>  }
> @@ -459,8 +455,7 @@ static int exynos_bus_probe(struct platform_device *pdev)
>  	dev_pm_opp_of_remove_table(dev);
>  	clk_disable_unprepare(bus->clk);
>  err_reg:
> -	dev_pm_opp_put_regulators(bus->opp_table);
> -	bus->opp_table = NULL;
> +	dev_pm_opp_put_regulators(bus->opp_token);
>  
>  	return ret;
>  }

Reviewed-by: Chanwoo Choi <cw00.choi@...sung.com>

Thanks.


(snip)


-- 
Best Regards,
Samsung Electronics
Chanwoo Choi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ