mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
Merge branches 'pm-cpufreq' and 'pm-cpuidle'
* pm-cpufreq: cpufreq: fix a NULL pointer dereference in __cpufreq_governor() cpufreq-dt: defer probing if OPP table is not ready * pm-cpuidle: cpuidle / ACPI: remove unused CPUIDLE_FLAG_TIME_INVALID cpuidle: ladder: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID cpuidle: menu: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID
This commit is contained in:
commit
ff23ab2441
6 changed files with 28 additions and 26 deletions
|
|
@ -79,12 +79,7 @@ static int ladder_select_state(struct cpuidle_driver *drv,
|
|||
|
||||
last_state = &ldev->states[last_idx];
|
||||
|
||||
if (!(drv->states[last_idx].flags & CPUIDLE_FLAG_TIME_INVALID)) {
|
||||
last_residency = cpuidle_get_last_residency(dev) - \
|
||||
drv->states[last_idx].exit_latency;
|
||||
}
|
||||
else
|
||||
last_residency = last_state->threshold.promotion_time + 1;
|
||||
last_residency = cpuidle_get_last_residency(dev) - drv->states[last_idx].exit_latency;
|
||||
|
||||
/* consider promotion */
|
||||
if (last_idx < drv->state_count - 1 &&
|
||||
|
|
|
|||
|
|
@ -396,8 +396,8 @@ static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
|||
* power state and occurrence of the wakeup event.
|
||||
*
|
||||
* If the entered idle state didn't support residency measurements,
|
||||
* we are basically lost in the dark how much time passed.
|
||||
* As a compromise, assume we slept for the whole expected time.
|
||||
* we use them anyway if they are short, and if long,
|
||||
* truncate to the whole expected time.
|
||||
*
|
||||
* Any measured amount of time will include the exit latency.
|
||||
* Since we are interested in when the wakeup begun, not when it
|
||||
|
|
@ -405,23 +405,18 @@ static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
|||
* the measured amount of time is less than the exit latency,
|
||||
* assume the state was never reached and the exit latency is 0.
|
||||
*/
|
||||
if (unlikely(target->flags & CPUIDLE_FLAG_TIME_INVALID)) {
|
||||
/* Use timer value as is */
|
||||
|
||||
/* measured value */
|
||||
measured_us = cpuidle_get_last_residency(dev);
|
||||
|
||||
/* Deduct exit latency */
|
||||
if (measured_us > target->exit_latency)
|
||||
measured_us -= target->exit_latency;
|
||||
|
||||
/* Make sure our coefficients do not exceed unity */
|
||||
if (measured_us > data->next_timer_us)
|
||||
measured_us = data->next_timer_us;
|
||||
|
||||
} else {
|
||||
/* Use measured value */
|
||||
measured_us = cpuidle_get_last_residency(dev);
|
||||
|
||||
/* Deduct exit latency */
|
||||
if (measured_us > target->exit_latency)
|
||||
measured_us -= target->exit_latency;
|
||||
|
||||
/* Make sure our coefficients do not exceed unity */
|
||||
if (measured_us > data->next_timer_us)
|
||||
measured_us = data->next_timer_us;
|
||||
}
|
||||
|
||||
/* Update our correction ratio */
|
||||
new_factor = data->correction_factor[data->bucket];
|
||||
new_factor -= new_factor / DECAY;
|
||||
|
|
|
|||
Loading…
Reference in a new issue