@@ -221,6 +221,10 @@ EXPORT_SYMBOL_GPL(menu_hrtimer_cancel);
static enum hrtimer_restart menu_hrtimer_notify(struct hrtimer *hrtimer)
{
int cpu = smp_processor_id();
+ struct menu_device *data = &per_cpu(menu_devices, cpu);
+
+ if (per_cpu(hrtimer_started, cpu) == 2)
+ data->correction_factor[data->bucket] = RESOLUTION * DECAY;
per_cpu(hrtimer_started, cpu) = 0;
@@ -386,7 +390,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
hrtimer_start(hrtmr, ns_to_ktime(1000 * timer_us),
HRTIMER_MODE_REL_PINNED);
/* menu hrtimer is started */
- per_cpu(hrtimer_started, cpu) = 1;
+ per_cpu(hrtimer_started, cpu) = 2;
}
}