In function cpu_stop_cpu_callback, BUG_ON(stopper->thread ||stopper->enabled || !list_empty(&stopper->works)) is triggered whilerestarting sometimes.

From: chpoph
Date: Thu Aug 02 2012 - 13:13:00 EST


In function cpu_stop_cpu_callback, BUG_ON(stopper->thread ||
stopper->enabled || !list_empty(&stopper->works)) is triggered
sometimes.
/* manage stopper for a cpu, mostly lifted from sched migration thread mgmt */
static int __cpuinit cpu_stop_cpu_callback(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
..................................
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_UP_PREPARE:
BUG_ON(stopper->thread || stopper->enabled ||
!list_empty(&stopper->works));
.................................
}

Before actually hardware restarting, machine_restart(cmd) will be called.

void machine_restart(char *cmd)
{
machine_shutdown();
arm_pm_restart(reboot_mode, cmd);
......................
}

after machine_shutdown(), all other cpus are set offline only by
settting the cpumask. if userspace software which regulators cpu are
running before arm_pm_restart(), it may set set another cpu online and
cpu_up(cpu) is called. At this situation, BUG_ON(stopper->thread ||
stopper->enabled || !list_empty(&stopper->works)) is triggered in
cpu_stop_cpu_callback.

Is it needed to preempt disable before calling machine_shutdown()?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/