diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 542b4fa2cda9b0051d9a6fe11a7d642e2d2bbc59..27f504fc36d28af871fee26704d7574aa1824e3a 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -507,6 +507,7 @@ extern void __init hrtimers_init(void); extern void sysrq_timer_list_show(void); int hrtimers_prepare_cpu(unsigned int cpu); +int hrtimers_cpu_starting(unsigned int cpu); #ifdef CONFIG_HOTPLUG_CPU int hrtimers_dead_cpu(unsigned int cpu); #else diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index ce8fe5adafb01960f87e39b33e99f49d4f18969c..300eb4039f2671444774aabeea765270424f6403 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1882,6 +1882,15 @@ int hrtimers_prepare_cpu(unsigned int cpu) } cpu_base->cpu = cpu; + hrtimer_cpu_base_init_expiry_lock(cpu_base); + return 0; +} + +int hrtimers_cpu_starting(unsigned int cpu) +{ + struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); + + /* Clear out any left over state from a CPU down operation */ cpu_base->active_bases = 0; cpu_base->hres_active = 0; cpu_base->hang_detected = 0; @@ -1974,6 +1983,7 @@ int hrtimers_dead_cpu(unsigned int scpu) void __init hrtimers_init(void) { hrtimers_prepare_cpu(smp_processor_id()); + hrtimers_cpu_starting(smp_processor_id()); open_softirq(HRTIMER_SOFTIRQ, hrtimer_run_softirq); }