Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 482db203 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cpuidle: lpm-levels: Correct calculation for idx_restrict_time"

parents 566dc414 71b28d5d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -505,7 +505,8 @@ static uint64_t lpm_cpuidle_predict(struct cpuidle_device *dev,
		for (j = 1; j < cpu->nlevels; j++) {
			struct lpm_cpu_level *level = &cpu->levels[j];
			uint32_t min_residency = level->pwr.min_residency;
			uint32_t max_residency = level->pwr.max_residency;
			uint32_t max_residency = 0;
			struct lpm_cpu_level *lvl;
			uint32_t failed = 0;
			uint64_t total = 0;

@@ -520,6 +521,8 @@ static uint64_t lpm_cpuidle_predict(struct cpuidle_device *dev,
				*idx_restrict = j;
				do_div(total, failed);
				for (i = 0; i < j; i++) {
					lvl = &cpu->levels[i];
					max_residency = lvl->pwr.max_residency;
					if (total < max_residency) {
						*idx_restrict = i + 1;
						total = max_residency;