Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 0061c68

Browse files
zhengshaobo1Treehugger Robot
authored andcommitted
FROMGIT: thermal: gov_power_allocator: Granted power set to max when nobody request power
When total_req_power is 0, divvy_up_power() will set granted_power to 0, and cdev will be limited to the lowest performance. If our polling delay is set to 200ms, it means that cdev cannot perform better within 200ms even if cdev has a sudden load. This will affect the performance of cdev and is not as expected. For this reason, if nobody requests power, then set the granted power to the max_power. Signed-off-by: zhengshaobo1 <[email protected]> Bug: 375959779 (cherry picked from commit 08eb049 https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal) Change-Id: I6e7360d8e6b886d9f1f23e9e4fd41f197605d520 Signed-off-by: zhengshaobo1 <[email protected]>
1 parent 4254247 commit 0061c68

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/thermal/gov_power_allocator.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,16 @@ static void divvy_up_power(u32 *req_power, u32 *max_power, int num_actors,
341341
u32 extra_power, capped_extra_power;
342342
int i;
343343

344-
/*
345-
* Prevent division by 0 if none of the actors request power.
346-
*/
347-
if (!total_req_power)
348-
total_req_power = 1;
344+
if (!total_req_power) {
345+
/*
346+
* Nobody requested anything, just give everybody
347+
* the maximum power
348+
*/
349+
for (i = 0; i < num_actors; i++)
350+
granted_power[i] = max_power[i];
351+
352+
return;
353+
}
349354

350355
capped_extra_power = 0;
351356
extra_power = 0;

0 commit comments

Comments
 (0)