cpufreq: powernv: Return the actual CPU frequency in /proc/cpuinfo

Message ID 1507274648-14221-1-git-send-email-shriyak@linux.vnet.ibm.com
State New
Headers show
Series
  • cpufreq: powernv: Return the actual CPU frequency in /proc/cpuinfo
Related show

Commit Message

Shriya Oct. 6, 2017, 7:24 a.m.
Make /proc/cpuinfo read the frequency of the CPU it is running at
instead of reading the cached value of the last requested frequency.
In conditions like WOF/throttle CPU can be running at a different
frequency than the requested frequency.

Signed-off-by: Shriya <shriyak@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Ellerman Oct. 6, 2017, 10:30 a.m. | #1
Shriya <shriyak@linux.vnet.ibm.com> writes:

> Make /proc/cpuinfo read the frequency of the CPU it is running at
> instead of reading the cached value of the last requested frequency.
> In conditions like WOF/throttle CPU can be running at a different
> frequency than the requested frequency.

Sounds like a bug fix to me ?

cheers

> diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
> index 897aa14..55ea4bf 100644
> --- a/arch/powerpc/platforms/powernv/setup.c
> +++ b/arch/powerpc/platforms/powernv/setup.c
> @@ -311,7 +311,7 @@ static unsigned long pnv_get_proc_freq(unsigned int cpu)
>  {
>  	unsigned long ret_freq;
>  
> -	ret_freq = cpufreq_quick_get(cpu) * 1000ul;
> +	ret_freq = cpufreq_get(cpu) * 1000ul;
>  
>  	/*
>  	 * If the backend cpufreq driver does not exist,
> -- 
> 1.9.1
Shriya Oct. 6, 2017, 11:22 a.m. | #2
On 2017-10-06 16:00, Michael Ellerman wrote:
> Shriya <shriyak@linux.vnet.ibm.com> writes:
> 
>> Make /proc/cpuinfo read the frequency of the CPU it is running at
>> instead of reading the cached value of the last requested frequency.
>> In conditions like WOF/throttle CPU can be running at a different
>> frequency than the requested frequency.
> 
> Sounds like a bug fix to me ?
> 
> cheers
> 
>> diff --git a/arch/powerpc/platforms/powernv/setup.c 
>> b/arch/powerpc/platforms/powernv/setup.c
>> index 897aa14..55ea4bf 100644
>> --- a/arch/powerpc/platforms/powernv/setup.c
>> +++ b/arch/powerpc/platforms/powernv/setup.c
>> @@ -311,7 +311,7 @@ static unsigned long pnv_get_proc_freq(unsigned 
>> int cpu)
>>  {
>>  	unsigned long ret_freq;
>> 
>> -	ret_freq = cpufreq_quick_get(cpu) * 1000ul;
>> +	ret_freq = cpufreq_get(cpu) * 1000ul;
>> 
>>  	/*
>>  	 * If the backend cpufreq driver does not exist,
>> --
>> 1.9.1

Yes, its a bug fix.

Thanks.

Patch

diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 897aa14..55ea4bf 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -311,7 +311,7 @@  static unsigned long pnv_get_proc_freq(unsigned int cpu)
 {
 	unsigned long ret_freq;
 
-	ret_freq = cpufreq_quick_get(cpu) * 1000ul;
+	ret_freq = cpufreq_get(cpu) * 1000ul;
 
 	/*
 	 * If the backend cpufreq driver does not exist,