linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin
@ 2018-01-12  7:13 Shilpasri G Bhat
  2018-01-12  9:07 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Shilpasri G Bhat @ 2018-01-12  7:13 UTC (permalink / raw)
  To: rjw
  Cc: viresh.kumar, mpe, linux-pm, linuxppc-dev, linux-kernel, ego,
	svaidy, akshay.adiga, huntbag, Shilpasri G Bhat

Some OpenPOWER boxes can have same pstate values for nominal and
pmin pstates. In these boxes the current code will not initialize
'powernv_pstate_info.min' variable and result in erroneous CPU
frequency reporting. This patch fixes this problem.

Fixes: 09ca4c9b5958 ("cpufreq: powernv: Replacing pstate_id with frequency table index")
Reported-by: Alvin Wang <wangat@tw.ibm.com>
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
---
 drivers/cpufreq/powernv-cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
index b6d7c4c..da7fdb4 100644
--- a/drivers/cpufreq/powernv-cpufreq.c
+++ b/drivers/cpufreq/powernv-cpufreq.c
@@ -288,9 +288,9 @@ static int init_powernv_pstates(void)
 
 		if (id == pstate_max)
 			powernv_pstate_info.max = i;
-		else if (id == pstate_nominal)
+		if (id == pstate_nominal)
 			powernv_pstate_info.nominal = i;
-		else if (id == pstate_min)
+		if (id == pstate_min)
 			powernv_pstate_info.min = i;
 
 		if (powernv_pstate_info.wof_enabled && id == pstate_turbo) {
-- 
1.8.3.1

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

* Re: [PATCH] cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin
  2018-01-12  7:13 [PATCH] cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin Shilpasri G Bhat
@ 2018-01-12  9:07 ` Viresh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2018-01-12  9:07 UTC (permalink / raw)
  To: Shilpasri G Bhat
  Cc: rjw, mpe, linux-pm, linuxppc-dev, linux-kernel, ego, svaidy,
	akshay.adiga, huntbag

On 12-01-18, 12:43, Shilpasri G Bhat wrote:
> Some OpenPOWER boxes can have same pstate values for nominal and
> pmin pstates. In these boxes the current code will not initialize
> 'powernv_pstate_info.min' variable and result in erroneous CPU
> frequency reporting. This patch fixes this problem.
> 
> Fixes: 09ca4c9b5958 ("cpufreq: powernv: Replacing pstate_id with frequency table index")
> Reported-by: Alvin Wang <wangat@tw.ibm.com>
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
> ---
>  drivers/cpufreq/powernv-cpufreq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
> index b6d7c4c..da7fdb4 100644
> --- a/drivers/cpufreq/powernv-cpufreq.c
> +++ b/drivers/cpufreq/powernv-cpufreq.c
> @@ -288,9 +288,9 @@ static int init_powernv_pstates(void)
>  
>  		if (id == pstate_max)
>  			powernv_pstate_info.max = i;
> -		else if (id == pstate_nominal)
> +		if (id == pstate_nominal)
>  			powernv_pstate_info.nominal = i;
> -		else if (id == pstate_min)
> +		if (id == pstate_min)
>  			powernv_pstate_info.min = i;
>  
>  		if (powernv_pstate_info.wof_enabled && id == pstate_turbo) {

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

-- 
viresh

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

end of thread, other threads:[~2018-01-12  9:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12  7:13 [PATCH] cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin Shilpasri G Bhat
2018-01-12  9:07 ` 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).