Patch "powercap: dtpm_cpu: Fix error check against freq_qos_add_request()" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    powercap: dtpm_cpu: Fix error check against freq_qos_add_request()

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powercap-dtpm_cpu-fix-error-check-against-freq_qos_a.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 10b9a364502cf200fb308e6222ae6548d58a875d
Author: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
Date:   Tue Feb 13 23:39:47 2024 +0100

    powercap: dtpm_cpu: Fix error check against freq_qos_add_request()
    
    [ Upstream commit b50155cb0d609437236c88201206267835c6f965 ]
    
    The caller of the function freq_qos_add_request() checks again a non
    zero value but freq_qos_add_request() can return '1' if the request
    already exists. Therefore, the setup function fails while the QoS
    request actually did not failed.
    
    Fix that by changing the check against a negative value like all the
    other callers of the function.
    
    Fixes: 0e8f68d7f0485 ("Add CPU energy model based support")
    Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c
index 9193c3b8edebe..ae7ee611978ba 100644
--- a/drivers/powercap/dtpm_cpu.c
+++ b/drivers/powercap/dtpm_cpu.c
@@ -219,7 +219,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
 	ret = freq_qos_add_request(&policy->constraints,
 				   &dtpm_cpu->qos_req, FREQ_QOS_MAX,
 				   pd->table[pd->nr_perf_states - 1].frequency);
-	if (ret)
+	if (ret < 0)
 		goto out_dtpm_unregister;
 
 	cpufreq_cpu_put(policy);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux