From patchwork Sat May 26 14:43:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 161487 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CF2AEB6FA0 for ; Sun, 27 May 2012 00:43:32 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753343Ab2EZOnb (ORCPT ); Sat, 26 May 2012 10:43:31 -0400 Received: from smtp.snhosting.dk ([87.238.248.203]:56297 "EHLO smtp.domainteam.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752666Ab2EZOna (ORCPT ); Sat, 26 May 2012 10:43:30 -0400 Received: from localhost.localdomain (unknown [188.228.89.252]) by smtp.domainteam.dk (Postfix) with ESMTPA id 23684F19C8; Sat, 26 May 2012 16:43:30 +0200 (CEST) From: Sam Ravnborg To: "David S. Miller" Cc: sparclinux , Daniel Hellstrom , Konrad Eisele , Sam Ravnborg Subject: [PATCH 1/4] sparc32: refactor cpu_idle() Date: Sat, 26 May 2012 16:43:26 +0200 Message-Id: <1338043409-6827-1-git-send-email-sam@ravnborg.org> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <20120526144047.GA6819@merkur.ravnborg.org> References: <20120526144047.GA6819@merkur.ravnborg.org> Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org With the removal of sun4c we can use the same cpu_idle() implementation on UP and SMP. This also fix it so we use the same version independent on LEON enabled or not. Signed-off-by: Sam Ravnborg Cc: Daniel Hellstrom Cc: Konrad Eisele --- arch/sparc/kernel/process_32.c | 28 ++-------------------------- 1 files changed, 2 insertions(+), 26 deletions(-) diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index fe6787c..7d6f60e 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c @@ -65,13 +65,13 @@ extern void fpsave(unsigned long *, unsigned long *, void *, unsigned long *); struct task_struct *last_task_used_math = NULL; struct thread_info *current_set[NR_CPUS]; -#ifndef CONFIG_SMP - /* * the idle loop on a Sparc... ;) */ void cpu_idle(void) { + set_thread_flag(TIF_POLLING_NRFLAG); + /* endless idle loop with no priority at all */ for (;;) { if (pm_idle) { @@ -85,30 +85,6 @@ void cpu_idle(void) } } -#else - -/* This is being executed in task 0 'user space'. */ -void cpu_idle(void) -{ - set_thread_flag(TIF_POLLING_NRFLAG); - /* endless idle loop with no priority at all */ - while(1) { -#ifdef CONFIG_SPARC_LEON - if (pm_idle) { - while (!need_resched()) - (*pm_idle)(); - } else -#endif - { - while (!need_resched()) - cpu_relax(); - } - schedule_preempt_disabled(); - } -} - -#endif - /* XXX cli/sti -> local_irq_xxx here, check this works once SMP is fixed. */ void machine_halt(void) {