From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985AbdJ2XOX (ORCPT ); Sun, 29 Oct 2017 19:14:23 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:48118 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932312AbdJ2XMw (ORCPT ); Sun, 29 Oct 2017 19:12:52 -0400 X-Google-Smtp-Source: ABhQp+Q7VGzw/HBjWY08xin2wJfcdlbBmntMRvQbJBrqkNjuhbP+8RBCKboGPo93a9bgsn3F/BQ85A== From: Stafford Horne To: LKML Cc: Stafford Horne , Jonas Bonn , Stefan Kristiansson , Jan Henrik Weinstock , openrisc@lists.librecores.org Subject: [PATCH v4 07/13] openrisc: fix initial preempt state for secondary cpu tasks Date: Mon, 30 Oct 2017 08:11:17 +0900 Message-Id: <20171029231123.27281-8-shorne@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171029231123.27281-1-shorne@gmail.com> References: <20171029231123.27281-1-shorne@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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.6 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stafford Horne Date: Mon, 30 Oct 2017 08:11:17 +0900 Subject: [OpenRISC] [PATCH v4 07/13] openrisc: fix initial preempt state for secondary cpu tasks In-Reply-To: <20171029231123.27281-1-shorne@gmail.com> References: <20171029231123.27281-1-shorne@gmail.com> Message-ID: <20171029231123.27281-8-shorne@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org 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 --- 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.6