From patchwork Mon Dec 22 06:38:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongsheng Wang X-Patchwork-Id: 423315 X-Patchwork-Delegate: michael@ellerman.id.au 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 2A6461400E7 for ; Mon, 22 Dec 2014 20:15:16 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 0B6591A0E5E for ; Mon, 22 Dec 2014 20:15:16 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org X-Greylist: delayed 8273 seconds by postgrey-1.35 at bilbo; Mon, 22 Dec 2014 20:14:45 AEDT Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0137.outbound.protection.outlook.com [207.46.100.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 266B81A0D4B for ; Mon, 22 Dec 2014 20:14:44 +1100 (AEDT) Received: from CH1PR03CA009.namprd03.prod.outlook.com (10.255.156.154) by BY2PR0301MB0725.namprd03.prod.outlook.com (25.160.63.155) with Microsoft SMTP Server (TLS) id 15.1.49.12; Mon, 22 Dec 2014 06:40:51 +0000 Received: from BY2FFO11FD007.protection.gbl (10.255.156.132) by CH1PR03CA009.outlook.office365.com (10.255.156.154) with Microsoft SMTP Server (TLS) id 15.1.31.17 via Frontend Transport; Mon, 22 Dec 2014 06:40:50 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD007.mail.protection.outlook.com (10.1.14.128) with Microsoft SMTP Server (TLS) id 15.1.49.13 via Frontend Transport; Mon, 22 Dec 2014 06:40:49 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id sBM6ebWV001955; Sun, 21 Dec 2014 23:40:39 -0700 From: Dongsheng Wang To: , , Subject: [PATCH] powerpc/smp: Fix Non-boot cpus cannot be bring up. Date: Mon, 22 Dec 2014 14:38:40 +0800 Message-ID: <1419230320-37558-1-git-send-email-dongsheng.wang@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Dongsheng.Wang@freescale.com; X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(199003)(189002)(86362001)(50986999)(105606002)(50466002)(36756003)(64706001)(106466001)(2201001)(229853001)(50226001)(104016003)(62966003)(4396001)(20776003)(47776003)(33646002)(77156002)(15975445007)(107046002)(92566001)(31966008)(87936001)(21056001)(85426001)(77096005)(68736005)(19580395003)(46102003)(48376002)(97736003)(6806004)(19580405001)(99396003)(89996001)(84676001)(120916001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0301MB0725; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0725; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:BY2PR0301MB0725; X-Forefront-PRVS: 0433DB2766 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB0725; X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2014 06:40:49.9080 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0725 Cc: linuxppc-dev@lists.ozlabs.org, Wang Dongsheng X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 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" From: Wang Dongsheng Kernel cannot bring up Non-boot cpus always get "Processor xx is stuck". this issue bring by http://patchwork.ozlabs.org/patch/418912/ (powerpc: Secondary CPUs must set cpu_callin_map after setting active and online) We need to take timebase after bootup cpu give the timebase firstly. When start_secondary, non-boot cpus set cpu_callin_map for boot cpu after that boot cpu will give the timebase for non-boot cpu. Otherwise non-boot cpus will fall in dead loop to waiting bootup cpu to give imebase. Signed-off-by: Wang Dongsheng Tested-by: Aaro Koskinen diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 8ec017c..9e29836 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -703,10 +703,6 @@ void start_secondary(void *unused) if (smp_ops->setup_cpu) smp_ops->setup_cpu(cpu); - if (smp_ops->take_timebase) - smp_ops->take_timebase(); - - secondary_cpu_time_init(); #ifdef CONFIG_PPC64 if (system_state == SYSTEM_RUNNING) @@ -746,6 +742,16 @@ void start_secondary(void *unused) smp_wmb(); cpu_callin_map[cpu] = 1; + /* + * We need to take timebase after bootup cpu give the timebase. + * Base on cpu_callin_map move to here, so we also need move + * take_timebase. Because bootup cpu waiting for cpu_callin_map + * be set after that give_timebase can be executed. + */ + if (smp_ops->take_timebase) + smp_ops->take_timebase(); + secondary_cpu_time_init(); + local_irq_enable(); cpu_startup_entry(CPUHP_ONLINE);