mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] cpufreq/amd-pstate: Add the missing cpufreq_cpu_put()
@ 2024-08-08 12:36 Dhananjay Ugwekar
  2024-08-09  5:14 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Dhananjay Ugwekar @ 2024-08-08 12:36 UTC (permalink / raw)
  To: ray.huang, gautham.shenoy, mario.limonciello, perry.yuan, rafael,
	viresh.kumar, li.meng
  Cc: linux-pm, linux-kernel, Dhananjay Ugwekar

Fix the reference counting of cpufreq_policy object in amd_pstate_update()
function by adding the missing cpufreq_cpu_put().

Fixes: e8f555daacd3 ("cpufreq/amd-pstate: fix setting policy current frequency value")
Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
Reviewed-by: Perry Yuan <perry.yuan@amd.com>
---
 drivers/cpufreq/amd-pstate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 804fab4ebb26..36edae40db1a 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -560,6 +560,8 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
 
 	amd_pstate_update_perf(cpudata, min_perf, des_perf,
 			       max_perf, fast_switch);
+
+	cpufreq_cpu_put(policy);
 }
 
 static int amd_pstate_verify(struct cpufreq_policy_data *policy)
-- 
2.34.1


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

* Re: [PATCH v2] cpufreq/amd-pstate: Add the missing cpufreq_cpu_put()
  2024-08-08 12:36 [PATCH v2] cpufreq/amd-pstate: Add the missing cpufreq_cpu_put() Dhananjay Ugwekar
@ 2024-08-09  5:14 ` Viresh Kumar
  2024-08-09  5:27   ` Dhananjay Ugwekar
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2024-08-09  5:14 UTC (permalink / raw)
  To: Dhananjay Ugwekar
  Cc: ray.huang, gautham.shenoy, mario.limonciello, perry.yuan, rafael,
	li.meng, linux-pm, linux-kernel

On 08-08-24, 12:36, Dhananjay Ugwekar wrote:
> Fix the reference counting of cpufreq_policy object in amd_pstate_update()
> function by adding the missing cpufreq_cpu_put().
> 
> Fixes: e8f555daacd3 ("cpufreq/amd-pstate: fix setting policy current frequency value")
> Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
> Reviewed-by: Perry Yuan <perry.yuan@amd.com>
> ---
>  drivers/cpufreq/amd-pstate.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 804fab4ebb26..36edae40db1a 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -560,6 +560,8 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
>  
>  	amd_pstate_update_perf(cpudata, min_perf, des_perf,
>  			       max_perf, fast_switch);
> +
> +	cpufreq_cpu_put(policy);

There is an early return path in this routine, which still doesn't
perform this action.

-- 
viresh

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

* Re: [PATCH v2] cpufreq/amd-pstate: Add the missing cpufreq_cpu_put()
  2024-08-09  5:14 ` Viresh Kumar
@ 2024-08-09  5:27   ` Dhananjay Ugwekar
  0 siblings, 0 replies; 3+ messages in thread
From: Dhananjay Ugwekar @ 2024-08-09  5:27 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: ray.huang, gautham.shenoy, mario.limonciello, perry.yuan, rafael,
	li.meng, linux-pm, linux-kernel



On 8/9/2024 10:44 AM, Viresh Kumar wrote:
> On 08-08-24, 12:36, Dhananjay Ugwekar wrote:
>> Fix the reference counting of cpufreq_policy object in amd_pstate_update()
>> function by adding the missing cpufreq_cpu_put().
>>
>> Fixes: e8f555daacd3 ("cpufreq/amd-pstate: fix setting policy current frequency value")
>> Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
>> Reviewed-by: Perry Yuan <perry.yuan@amd.com>
>> ---
>>  drivers/cpufreq/amd-pstate.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
>> index 804fab4ebb26..36edae40db1a 100644
>> --- a/drivers/cpufreq/amd-pstate.c
>> +++ b/drivers/cpufreq/amd-pstate.c
>> @@ -560,6 +560,8 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
>>  
>>  	amd_pstate_update_perf(cpudata, min_perf, des_perf,
>>  			       max_perf, fast_switch);
>> +
>> +	cpufreq_cpu_put(policy);
> 
> There is an early return path in this routine, which still doesn't
> perform this action.

Thanks for catching this, will fix in next version

Regards,
Dhananjay

> 

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

end of thread, other threads:[~2024-08-09  5:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-08 12:36 [PATCH v2] cpufreq/amd-pstate: Add the missing cpufreq_cpu_put() Dhananjay Ugwekar
2024-08-09  5:14 ` Viresh Kumar
2024-08-09  5:27   ` Dhananjay Ugwekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®