mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
Merge "drivers: cpuidle: lpm-levels: Move local_irq_enable"
This commit is contained in:
commit
5ecbe390cb
1 changed files with 18 additions and 3 deletions
|
|
@ -195,6 +195,11 @@ static void histtimer_cancel(void)
|
|||
{
|
||||
unsigned int cpu = raw_smp_processor_id();
|
||||
struct hrtimer *cpu_histtimer = &per_cpu(histtimer, cpu);
|
||||
ktime_t time_rem;
|
||||
|
||||
time_rem = hrtimer_get_remaining(cpu_histtimer);
|
||||
if (ktime_to_us(time_rem) <= 0)
|
||||
return;
|
||||
|
||||
hrtimer_try_to_cancel(cpu_histtimer);
|
||||
}
|
||||
|
|
@ -240,11 +245,21 @@ static void clusttimer_cancel(void)
|
|||
{
|
||||
int cpu = raw_smp_processor_id();
|
||||
struct lpm_cluster *cluster = per_cpu(cpu_lpm, cpu)->parent;
|
||||
ktime_t time_rem;
|
||||
|
||||
hrtimer_try_to_cancel(&cluster->histtimer);
|
||||
time_rem = hrtimer_get_remaining(&cluster->histtimer);
|
||||
if (ktime_to_us(time_rem) > 0)
|
||||
hrtimer_try_to_cancel(&cluster->histtimer);
|
||||
|
||||
if (cluster->parent) {
|
||||
time_rem = hrtimer_get_remaining(
|
||||
&cluster->parent->histtimer);
|
||||
|
||||
if (ktime_to_us(time_rem) <= 0)
|
||||
return;
|
||||
|
||||
if (cluster->parent)
|
||||
hrtimer_try_to_cancel(&cluster->parent->histtimer);
|
||||
}
|
||||
}
|
||||
|
||||
static enum hrtimer_restart clusttimer_fn(struct hrtimer *h)
|
||||
|
|
@ -1197,11 +1212,11 @@ exit:
|
|||
dev->last_residency = ktime_us_delta(ktime_get(), start);
|
||||
update_history(dev, idx);
|
||||
trace_cpu_idle_exit(idx, success);
|
||||
local_irq_enable();
|
||||
if (lpm_prediction && cpu->lpm_prediction) {
|
||||
histtimer_cancel();
|
||||
clusttimer_cancel();
|
||||
}
|
||||
local_irq_enable();
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue