From patchwork Wed Jun 25 01:15:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 363781 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B0E0B1400D5 for ; Wed, 25 Jun 2014 11:16:42 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 9EC691A014C for ; Wed, 25 Jun 2014 11:16:42 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2lp0235.outbound.protection.outlook.com [207.46.163.235]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id A6F3F1A0010 for ; Wed, 25 Jun 2014 11:16:06 +1000 (EST) Received: from snotra.am.freescale.net (192.88.168.49) by DM2PR03MB398.namprd03.prod.outlook.com (10.141.84.140) with Microsoft SMTP Server (TLS) id 15.0.954.9; Wed, 25 Jun 2014 01:15:59 +0000 From: Scott Wood To: Subject: [PATCH] powerpc: Don't skip ePAPR spin-table CPUs Date: Tue, 24 Jun 2014 20:15:51 -0500 Message-ID: <1403658951-23158-1-git-send-email-scottwood@freescale.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [192.88.168.49] X-ClientProxiedBy: BLUPR08CA0054.namprd08.prod.outlook.com (10.141.200.34) To DM2PR03MB398.namprd03.prod.outlook.com (10.141.84.140) X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: X-Forefront-PRVS: 02530BD3AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(6009001)(199002)(189002)(20776003)(47776003)(66066001)(95666004)(101416001)(79102001)(80022001)(77156001)(99396002)(77096002)(85306003)(62966002)(50986999)(86362001)(105586002)(81542001)(106356001)(42186005)(81342001)(64706001)(92566001)(93916002)(104166001)(83072002)(85852003)(31966008)(77982001)(50226001)(92726001)(19580395003)(83322001)(36756003)(74662001)(74502001)(19580405001)(33646001)(87976001)(50466002)(48376002)(102836001)(87286001)(4396001)(89996001)(88136002)(76482001)(21056001)(46102001); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR03MB398; H:snotra.am.freescale.net; FPR:; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-OriginatorOrg: freescale.com Cc: Scott Wood , Michael Neuling , stable@vger.kernel.org, Emil Medve X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Commit 59a53afe70fd530040bdc69581f03d880157f15a "powerpc: Don't setup CPUs with bad status" broke ePAPR SMP booting. ePAPR says that CPUs that aren't presently running shall have status of disabled, with enable-method being used to determine whether the CPU can be enabled. Fix by checking for spin-table, which is currently the only supported enable-method. Signed-off-by: Scott Wood Cc: Michael Neuling Cc: Emil Medve Cc: stable@vger.kernel.org --- arch/powerpc/kernel/setup-common.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index e239df3..e5b022c 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -469,9 +469,17 @@ void __init smp_setup_cpu_maps(void) } for (j = 0; j < nthreads && cpu < nr_cpu_ids; j++) { + bool avail; + DBG(" thread %d -> cpu %d (hard id %d)\n", j, cpu, be32_to_cpu(intserv[j])); - set_cpu_present(cpu, of_device_is_available(dn)); + + avail = of_device_is_available(dn); + if (!avail) + avail = !of_property_match_string(dn, + "enable-method", "spin-table"); + + set_cpu_present(cpu, avail); set_hard_smp_processor_id(cpu, be32_to_cpu(intserv[j])); set_cpu_possible(cpu, true); cpu++;