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: <20231226055936.pzyt4xjzlfhfqb4y@vireshk-i7>
Date: Tue, 26 Dec 2023 11:29:36 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
Cc: vireshk@...nel.org, nm@...com, sboyd@...nel.org, ulf.hansson@...aro.org,
	stephan.gerhold@...nkonzept.com, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] OPP: Fix _set_required_opps when opp is NULL

On 23-12-23, 02:34, Bryan O'Donoghue wrote:
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index c022d548067d7..182e07ab6baf3 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -1083,7 +1083,11 @@ static int _set_required_opps(struct device *dev, struct opp_table *opp_table,
>  
>  	while (index != target) {
>  		if (devs[index]) {
> -			ret = dev_pm_opp_set_opp(devs[index], opp->required_opps[index]);
> +			if (opp)
> +				ret = dev_pm_opp_set_opp(devs[index], opp->required_opps[index]);
> +			else
> +				ret = dev_pm_domain_set_performance_state(devs[index], 0);
> +
>  			if (ret)
>  				return ret;
>  		}

Sorry about that, my mistake. Can you test below instead please ?

diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index c022d548067d..c4d695e0e5fd 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -1061,6 +1061,7 @@ static int _set_required_opps(struct device *dev, struct opp_table *opp_table,
                              struct dev_pm_opp *opp, bool up)
 {
        struct device **devs = opp_table->required_devs;
+       struct dev_pm_opp *required_opp;
        int index, target, delta, ret;

        if (!devs)
@@ -1083,7 +1084,9 @@ static int _set_required_opps(struct device *dev, struct opp_table *opp_table,

        while (index != target) {
                if (devs[index]) {
-                       ret = dev_pm_opp_set_opp(devs[index], opp->required_opps[index]);
+                       required_opp = opp ? opp->required_opps[index] : NULL;
+
+                       ret = dev_pm_opp_set_opp(devs[index], required_opp);
                        if (ret)
                                return ret;
                }

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ