linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: imx6q: add return value check for voltage scale
@ 2018-11-05  0:59 Anson Huang
  2018-11-05  2:31 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Anson Huang @ 2018-11-05  0:59 UTC (permalink / raw)
  To: rjw, viresh.kumar, linux-pm, linux-kernel; +Cc: dl-linux-imx

Add return value check for voltage scale when ARM clock
rate change fail.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/cpufreq/imx6q-cpufreq.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index 8cfee0a..d8c3595 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -160,8 +160,13 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)
 	/* Ensure the arm clock divider is what we expect */
 	ret = clk_set_rate(clks[ARM].clk, new_freq * 1000);
 	if (ret) {
+		int ret1;
+
 		dev_err(cpu_dev, "failed to set clock rate: %d\n", ret);
-		regulator_set_voltage_tol(arm_reg, volt_old, 0);
+		ret1 = regulator_set_voltage_tol(arm_reg, volt_old, 0);
+		if (ret1)
+			dev_warn(cpu_dev,
+				 "failed to restore vddarm voltage: %d\n", ret1);
 		return ret;
 	}
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cpufreq: imx6q: add return value check for voltage scale
  2018-11-05  0:59 [PATCH] cpufreq: imx6q: add return value check for voltage scale Anson Huang
@ 2018-11-05  2:31 ` Viresh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2018-11-05  2:31 UTC (permalink / raw)
  To: Anson Huang; +Cc: rjw, linux-pm, linux-kernel, dl-linux-imx

On 05-11-18, 00:59, Anson Huang wrote:
> Add return value check for voltage scale when ARM clock
> rate change fail.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
>  drivers/cpufreq/imx6q-cpufreq.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
> index 8cfee0a..d8c3595 100644
> --- a/drivers/cpufreq/imx6q-cpufreq.c
> +++ b/drivers/cpufreq/imx6q-cpufreq.c
> @@ -160,8 +160,13 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)
>  	/* Ensure the arm clock divider is what we expect */
>  	ret = clk_set_rate(clks[ARM].clk, new_freq * 1000);
>  	if (ret) {
> +		int ret1;
> +
>  		dev_err(cpu_dev, "failed to set clock rate: %d\n", ret);
> -		regulator_set_voltage_tol(arm_reg, volt_old, 0);
> +		ret1 = regulator_set_voltage_tol(arm_reg, volt_old, 0);
> +		if (ret1)
> +			dev_warn(cpu_dev,
> +				 "failed to restore vddarm voltage: %d\n", ret1);
>  		return ret;
>  	}
>  

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-05  2:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05  0:59 [PATCH] cpufreq: imx6q: add return value check for voltage scale Anson Huang
2018-11-05  2:31 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).