Patch "thermal: gov_power_allocator: Fix incorrect calculation in divvy_up_power()" has been added to the 6.12-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

    thermal: gov_power_allocator: Fix incorrect calculation in divvy_up_power()

to the 6.12-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:
     thermal-gov_power_allocator-fix-incorrect-calculatio.patch
and it can be found in the queue-6.12 subdirectory.

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



commit 7ec732857583bf683c75cefe3e716018ef20b77a
Author: Yu-Che Cheng <giver@xxxxxxxxxxxx>
Date:   Wed Feb 19 15:07:48 2025 +0800

    thermal: gov_power_allocator: Fix incorrect calculation in divvy_up_power()
    
    [ Upstream commit 4ecaa75771a75f2b78a431bf67dea165d19d72a6 ]
    
    divvy_up_power() should use weighted_req_power instead of req_power to
    calculate granted_power. Otherwise, granted_power may be unexpected as
    the denominator total_req_power is a weighted sum.
    
    This is a mistake made during the previous refactor.
    
    Replace req_power with weighted_req_power in divvy_up_power()
    calculation.
    
    Fixes: 912e97c67cc3 ("thermal: gov_power_allocator: Move memory allocation out of throttle()")
    Signed-off-by: Yu-Che Cheng <giver@xxxxxxxxxxxx>
    Reviewed-by: Lukasz Luba <lukasz.luba@xxxxxxx>
    Link: https://patch.msgid.link/20250219-fix-power-allocator-calc-v1-1-48b860291919@xxxxxxxxxxxx
    [ rjw: Subject and changelog edits ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index 1b2345a697c5a..d59549e616399 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -364,7 +364,7 @@ static void divvy_up_power(struct power_actor *power, int num_actors,
 
 	for (i = 0; i < num_actors; i++) {
 		struct power_actor *pa = &power[i];
-		u64 req_range = (u64)pa->req_power * power_range;
+		u64 req_range = (u64)pa->weighted_req_power * power_range;
 
 		pa->granted_power = DIV_ROUND_CLOSEST_ULL(req_range,
 							  total_req_power);




[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