[PATCH] ARM: Fix "BUG: scheduling while atomic: swapper/0/0x00000002"

Russell King - ARM Linux linux at arm.linux.org.uk
Fri Mar 19 08:13:12 EDT 2010


On Wed, Mar 17, 2010 at 10:51:44AM +0530, Shilimkar, Santosh wrote:
> On SMP kernel with PREEMPT enabled, if you try to offline the CPU using hot-plug and then
> bring it back(online), you will get this dump. Since CPU is taken out from idle thread, the
> process shown is 2.

Hmm, I don't think this is how we should be solving this problem.
x86 calls init_idle() on the idle task when it's re-used, and this
resets the preempt count amongst other things.  So maybe we want to
do this instead in the __cpu_up path:

	if (!idle) {
		idle = fork_idle(cpu);
		if (IS_ERR(idle)) {
			printk(KERN_ERR "CPU%u: fork() failed\n", cpu);
			return PTR_ERR(idle);
		}
		ci->idle = idle;
-	}
+	} else {
+		init_idle(idle);
+	}



More information about the linux-arm-kernel mailing list