]> www.infradead.org Git - users/jedix/linux-maple.git/commit
thermal: gov_power_allocator: Fix incorrect calculation in divvy_up_power()
authorYu-Che Cheng <giver@chromium.org>
Wed, 19 Feb 2025 07:07:48 +0000 (15:07 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 21 Feb 2025 17:13:10 +0000 (18:13 +0100)
commit4ecaa75771a75f2b78a431bf67dea165d19d72a6
tree4aa08151ccce1cf8edbe065196558b402f99e323
parent0ad2507d5d93f39619fc42372c347d6006b64319
thermal: gov_power_allocator: Fix incorrect calculation in divvy_up_power()

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@chromium.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20250219-fix-power-allocator-calc-v1-1-48b860291919@chromium.org
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/gov_power_allocator.c