openrisc: fix initial preempt state for secondary cpu tasks
authorStafford Horne <shorne@gmail.com>
Wed, 12 Jul 2017 08:20:38 +0000 (17:20 +0900)
committerStafford Horne <shorne@gmail.com>
Fri, 3 Nov 2017 05:01:14 +0000 (14:01 +0900)
During SMP testing we were getting the below warning after booting the
secondary cpu:

[    0.060000] BUG: scheduling while atomic: swapper/1/0/0x00000000

This change follows similar patterns from other architectures to start
the schduler with preempt disabled.

Signed-off-by: Stafford Horne <shorne@gmail.com>
arch/openrisc/include/asm/thread_info.h
arch/openrisc/kernel/smp.c

index 6e619a7..c229aa6 100644 (file)
@@ -74,7 +74,7 @@ struct thread_info {
        .task           = &tsk,                         \
        .flags          = 0,                            \
        .cpu            = 0,                            \
-       .preempt_count  = 1,                            \
+       .preempt_count  = INIT_PREEMPT_COUNT,           \
        .addr_limit     = KERNEL_DS,                    \
        .ksp            = 0,                            \
 }
index fd72412..154c94a 100644 (file)
@@ -128,6 +128,7 @@ asmlinkage __init void secondary_start_kernel(void)
 
        local_irq_enable();
 
+       preempt_disable();
        /*
         * OK, it's off to the idle thread for us
         */