From patchwork Sat Apr 30 02:08:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 743042 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3U28ljx027707 for ; Sat, 30 Apr 2011 02:09:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759636Ab1D3CJQ (ORCPT ); Fri, 29 Apr 2011 22:09:16 -0400 Received: from mail-gx0-f174.google.com ([209.85.161.174]:58265 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759593Ab1D3CJP (ORCPT ); Fri, 29 Apr 2011 22:09:15 -0400 Received: by mail-gx0-f174.google.com with SMTP id 21so1518898gxk.19 for ; Fri, 29 Apr 2011 19:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=CaDm9iugLG01WKc3ZhS9EN3FktK2j5CQXYbZtmzA4vg=; b=W16gtGI1wqrieIE3o5+IjdEGljpcj5BvsLq6gjlv6iPAl2poYrKoLuJ3yRJ5Sc/3wH YNywH7saaPikQ5ERXqZdYcbbxiEBSCBTyM8iik6hVddf62h0mRA+iCjz3oescLtGgZfF FcUj8Cp7f5iXrrm1g+iMB+FCI8CXvI4kkhsnE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=vRxngEE4X6W9c7TgXKNnuqS+ow2E7IshcI4tMrMddQfOIXBoa9R1zB1sHtrqWNa8Au +fyRVcvvTqkNsMjHALKcdO7IfHEFwJO9CLkQhp/2U0H4qcdYIqw4U7cR7aKDl+yEN5/r PsXbNPOmLCTHjLtS1lCZ7fdVtpLDk7sX9mvSY= Received: by 10.91.67.7 with SMTP id u7mr4749083agk.103.1304129354946; Fri, 29 Apr 2011 19:09:14 -0700 (PDT) Received: from rob-laptop.grandecom.net (65-36-74-215.dyn.grandenetworks.net [65.36.74.215]) by mx.google.com with ESMTPS id w6sm3345086anf.32.2011.04.29.19.09.13 (version=SSLv3 cipher=OTHER); Fri, 29 Apr 2011 19:09:14 -0700 (PDT) From: Rob Herring To: linux-arm-msm@vger.kernel.org, linux-sh@vger.kernel.org, Srinidhi Kasagar , Linus Walleij , Russell King , David Brown , Daniel Walker , Paul Mundt , linux-arm-kernel@lists.infradead.org Cc: Rob Herring Subject: [PATCH 10/10] ARM: move set_cpu_present calls to common smp code Date: Fri, 29 Apr 2011 21:08:17 -0500 Message-Id: <1304129297-6614-11-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1304129297-6614-1-git-send-email-robherring2@gmail.com> References: <1304129297-6614-1-git-send-email-robherring2@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 30 Apr 2011 02:09:17 +0000 (UTC) From: Rob Herring All platforms do the same thing and mark all cores present, so move this to common smp init code. A platform can still override this and mark a core not present if that is ever desired. Signed-off-by: Rob Herring --- arch/arm/kernel/smp.c | 4 ++++ arch/arm/mach-msm/platsmp.c | 11 +---------- arch/arm/mach-omap2/omap-smp.c | 9 --------- arch/arm/mach-realview/platsmp.c | 9 --------- arch/arm/mach-shmobile/platsmp.c | 5 ----- arch/arm/mach-ux500/platsmp.c | 9 --------- arch/arm/mach-vexpress/ct-ca9x4.c | 4 ---- arch/arm/mach-vexpress/platsmp.c | 5 +---- 8 files changed, 6 insertions(+), 50 deletions(-) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 8fe05ad..ccb912d 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -351,6 +351,7 @@ void __init smp_prepare_boot_cpu(void) void __init smp_prepare_cpus(unsigned int max_cpus) { + int i; unsigned int ncores = num_possible_cpus(); smp_store_cpu_info(smp_processor_id()); @@ -361,6 +362,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus) if (max_cpus > ncores) max_cpus = ncores; + for (i = 0; i < max_cpus; i++) + set_cpu_present(i, true); + if (max_cpus > 1) { /* * Enable the local timer or broadcast device for the diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c index 4315bb5..3ee7151 100644 --- a/arch/arm/mach-msm/platsmp.c +++ b/arch/arm/mach-msm/platsmp.c @@ -87,13 +87,4 @@ void __init smp_init_cpus(void) } void __init platform_smp_prepare_cpus(unsigned int max_cpus) -{ - int i; - - /* - * Initialise the present map, which describes the set of CPUs - * actually populated at the present time. - */ - for (i = 0; i < max_cpus; i++) - set_cpu_present(i, true); -} +{} diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 831c8a0..dfcc9ac 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c @@ -108,15 +108,6 @@ void __init smp_init_cpus(void) void __init platform_smp_prepare_cpus(unsigned int max_cpus) { - int i; - - /* - * Initialise the present map, which describes the set of CPUs - * actually populated at the present time. - */ - for (i = 0; i < max_cpus; i++) - set_cpu_present(i, true); - /* * Initialise the SCU and wake up the secondary core using * wakeup_secondary(). diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c index 655a93b..dc57494 100644 --- a/arch/arm/mach-realview/platsmp.c +++ b/arch/arm/mach-realview/platsmp.c @@ -48,15 +48,6 @@ void __init smp_init_cpus(void) void __init platform_smp_prepare_cpus(unsigned int max_cpus) { - int i; - - /* - * Initialise the present map, which describes the set of CPUs - * actually populated at the present time. - */ - for (i = 0; i < max_cpus; i++) - set_cpu_present(i, true); - scu_enable(scu_base_addr()); /* diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c index c681333..a9bdcda 100644 --- a/arch/arm/mach-shmobile/platsmp.c +++ b/arch/arm/mach-shmobile/platsmp.c @@ -50,10 +50,5 @@ void __init smp_init_cpus(void) void __init platform_smp_prepare_cpus(unsigned int max_cpus) { - int i; - - for (i = 0; i < max_cpus; i++) - set_cpu_present(i, true); - shmobile_smp_prepare_cpus(); } diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c index 7b19f9d..f8dd320 100644 --- a/arch/arm/mach-ux500/platsmp.c +++ b/arch/arm/mach-ux500/platsmp.c @@ -74,15 +74,6 @@ void __init smp_init_cpus(void) void __init platform_smp_prepare_cpus(unsigned int max_cpus) { - int i; - - /* - * Initialise the present map, which describes the set of CPUs - * actually populated at the present time. - */ - for (i = 0; i < max_cpus; i++) - set_cpu_present(i, true); - scu_enable(scu_base_addr()); wakeup_secondary(); } diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c index 4d1476f..aa366f1 100644 --- a/arch/arm/mach-vexpress/ct-ca9x4.c +++ b/arch/arm/mach-vexpress/ct-ca9x4.c @@ -211,10 +211,6 @@ static void ct_ca9x4_init_cpu_map(void) static void ct_ca9x4_smp_enable(unsigned int max_cpus) { - int i; - for (i = 0; i < max_cpus; i++) - set_cpu_present(i, true); - scu_enable(MMIO_P2V(A9_MPCORE_SCU)); } #endif diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c index 7fa0b68..0c301ed 100644 --- a/arch/arm/mach-vexpress/platsmp.c +++ b/arch/arm/mach-vexpress/platsmp.c @@ -31,10 +31,7 @@ void __init smp_init_cpus(void) void __init platform_smp_prepare_cpus(unsigned int max_cpus) { - /* - * Initialise the present map, which describes the set of CPUs - * actually populated at the present time. - */ + /* Enable the SCU */ ct_desc->smp_enable(max_cpus); /*