From: Stafford Horne <shorne@gmail.com>
To: openrisc@lists.librecores.org
Subject: [OpenRISC] [PATCH v2 08/14] openrisc: fix initial preempt state for secondary cpu tasks
Date: Sun, 10 Sep 2017 15:49:20 +0900 [thread overview]
Message-ID: <20170910064926.5874-9-shorne@gmail.com> (raw)
In-Reply-To: <20170910064926.5874-1-shorne@gmail.com>
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 | 2 +-
arch/openrisc/kernel/smp.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/openrisc/include/asm/thread_info.h b/arch/openrisc/include/asm/thread_info.h
index 6e619a79a401..c229aa6bb502 100644
--- a/arch/openrisc/include/asm/thread_info.h
+++ b/arch/openrisc/include/asm/thread_info.h
@@ -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, \
}
diff --git a/arch/openrisc/kernel/smp.c b/arch/openrisc/kernel/smp.c
index fd724123229a..154c94a0cfbc 100644
--- a/arch/openrisc/kernel/smp.c
+++ b/arch/openrisc/kernel/smp.c
@@ -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
*/
--
2.13.5
next prev parent reply other threads:[~2017-09-10 6:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-10 6:49 [OpenRISC] [PATCH v2 00/14] OpenRISC SMP Support Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 01/14] openrisc: use shadow registers to save regs on exception Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 02/14] openrisc: define CPU_BIG_ENDIAN as true Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 03/14] openrisc: add 1 and 2 byte cmpxchg support Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 04/14] openrisc: use qspinlocks and qrwlocks Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 05/14] dt-bindings: add openrisc to vendor prefixes list Stafford Horne
2017-09-10 11:13 ` Andreas =?unknown-8bit?q?F=C3=A4rber?=
2017-09-18 20:39 ` Rob Herring
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 06/14] irqchip: add initial support for ompic Stafford Horne
2017-09-13 17:21 ` Marc Zyngier
2017-09-14 6:54 ` Stafford Horne
2017-09-14 18:31 ` Marc Zyngier
2017-09-18 20:29 ` Rob Herring
2017-09-19 12:14 ` Stafford Horne
2017-09-18 20:43 ` Rob Herring
2017-09-19 12:10 ` Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 07/14] openrisc: initial SMP support Stafford Horne
2017-09-10 6:49 ` Stafford Horne [this message]
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 09/14] openrisc: sleep instead of spin on secondary wait Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 10/14] openrisc: add cacheflush support to fix icache aliasing Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 11/14] openrisc: add simple_smp dts and defconfig for simulators Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 12/14] openrisc: support framepointers and STACKTRACE_SUPPORT Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 13/14] openrisc: enable LOCKDEP_SUPPORT and irqflags tracing Stafford Horne
2017-09-10 6:49 ` [OpenRISC] [PATCH v2 14/14] openrisc: add tick timer multicore sync logic Stafford Horne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170910064926.5874-9-shorne@gmail.com \
--to=shorne@gmail.com \
--cc=openrisc@lists.librecores.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox