@@ -637,6 +637,13 @@ static void free_percpu_timers(unsigned int cpu)
ASSERT(ts->heap == dummy_heap);
}
+static void deinit_timers(unsigned int cpu)
+{
+ migrate_timers_from_cpu(cpu);
+ if ( !park_offline_cpus )
+ free_percpu_timers(cpu);
+}
+
static int cf_check cpu_callback(
struct notifier_block *nfb, unsigned long action, void *hcpu)
{
@@ -655,13 +662,14 @@ static int cf_check cpu_callback(
}
break;
- case CPU_UP_CANCELED:
case CPU_DEAD:
- case CPU_RESUME_FAILED:
- migrate_timers_from_cpu(cpu);
+ if ( system_state != SYS_STATE_suspend )
+ deinit_timers(cpu);
+ break;
- if ( !park_offline_cpus && system_state != SYS_STATE_suspend )
- free_percpu_timers(cpu);
+ case CPU_UP_CANCELED:
+ case CPU_RESUME_FAILED:
+ deinit_timers(cpu);
break;
case CPU_REMOVE: