Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754604AbbHFFoq (ORCPT ); Thu, 6 Aug 2015 01:44:46 -0400 Received: from mail-bl2on0144.outbound.protection.outlook.com ([65.55.169.144]:28233 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751422AbbHFFon (ORCPT ); Thu, 6 Aug 2015 01:44:43 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=scottwood@freescale.com; Message-ID: <1438839874.2097.149.camel@freescale.com> Subject: Re: [PATCH 3/3] PowerPC/mpc85xx: Add hotplug support on E6500 cores From: Scott Wood To: Chenhui Zhao CC: , , , Tang Yuantian , "linuxppc-dev@lists.ozlabs.org" Date: Thu, 6 Aug 2015 00:44:34 -0500 In-Reply-To: <1438835541.23384.1@remotesmtp.freescale.net> References: <1438334444-31919-1-git-send-email-b29983@freescale.com> <1438334444-31919-3-git-send-email-b29983@freescale.com> <1438388531.19345.88.camel@freescale.com> <1438772906.21522.2@remotesmtp.freescale.net> <1438831004.2097.146.camel@freescale.com> <1438835541.23384.1@remotesmtp.freescale.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.0-fta1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Originating-IP: [2601:448:8100:f9f:12bf:48ff:fe84:c9a0] X-ClientProxiedBy: DM2PR22CA0027.namprd22.prod.outlook.com (25.162.205.37) To BY1PR03MB1481.namprd03.prod.outlook.com (25.162.210.14) X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1481;2:ytRJINRA2aneumjx7M+Ek4JKoazd7QUBP7OJJ4eVW2lFx1/AbW2htJpj8+Z/1lfFvC4TMCZm3S1LxrEWw54Z6uiv4kr6pm0RR46kupDWw0R6dWkoUvnTB4//jrOXBk8CzqU4ngv1UFPabcYfUmyHuD9dW/SfpYzgfon7vCqCEx0=;3:NP/g55k76gUVi1mhu4RNTQ0Vj85fmB+Q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LhCohq9BzOxrXTDUHlO+iIwoomiFVOo5o9BzjH0Oxj56GhkEvw660lDs8oRCjbceNTiG/nOhoKkOfj4PUovL+qBpO+mnTotPiqPMmLp3OACBSQSyVDHGkp6SHzYIzl0/zrlN4Xp/VgAbaFDwDUpyZGEohvUd2fJnJvNavG1Zr8zA8s5LFIjtVCKa+SsE2Yy0huhmzdhVVp6JLP/0ZYGktsbgWb+TuWuEXZ+cVJZ3rbU+kFJ22mw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BY1PR03MB1481;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1481; X-Forefront-PRVS: 06607E485E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(24454002)(377424004)(199003)(377454003)(36756003)(92566002)(50986999)(86362001)(33646002)(42186005)(2950100001)(62966003)(46102003)(77156002)(189998001)(50226001)(93886004)(4001450100002)(77096005)(110136002)(122386002)(105586002)(5001830100001)(5001860100001)(5001960100002)(76176999)(15975445007)(68736005)(101416001)(19580395003)(19580405001)(40100003)(97736004)(4001540100001)(106356001)(81156007)(23676002)(50466002)(87976001)(5820100001)(103116003)(64706001)(47776003)(99106002)(3826002)(5001840100002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1481;H:[IPv6:2601:448:8100:f9f:12bf:48ff:fe84:c9a0];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTFQUjAzTUIxNDgxOzIzOllwalVQUHEzdWNwRWFmOTV4VENWVi9Pd0Jz?= =?utf-8?B?OCtPRXU2VHJLdG5uZUM0SWtyYTFxblZMTG11bWhzalNnSlRWOUdDMTJvWE5M?= =?utf-8?B?dWloTit5NTdFWmR2TDdwYy9laGRJd3RRbGNyenl5R1h4M09GTmNDbU5vV0tX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cpaoZJt48UdhNrvXNtFCgLqzbSz8=;20:sc0SaLOcEWflKCgB2I07ZVtFGFGkdik8OlYpFWAtS7oSZKW5dtoJ5wzS/Uz5dtJ+ykQU93Fg6qmziGUjmMizbA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2015 05:44:40.1913 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1481 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2995 Lines: 77 On Thu, 2015-08-06 at 12:32 +0800, Chenhui Zhao wrote: > On Thu, Aug 6, 2015 at 11:16 AM, Scott Wood > wrote: > > On Wed, 2015-08-05 at 19:08 +0800, Chenhui Zhao wrote: > > > On Sat, Aug 1, 2015 at 8:22 AM, Scott Wood > > > wrote: > > > > On Fri, 2015-07-31 at 17:20 +0800, b29983@freescale.comwrote: > > > > > + /* > > > > > + * If both threads are offline, reset core to > > > start. > > > > > + * When core is up, Thread 0 always gets up > > > first, > > > > > + * so bind the current logical cpu with Thread 0. > > > > > + */ > > > > > + if (hw_cpu != cpu_first_thread_sibling(hw_cpu)) { > > > > > + int hw_cpu1, hw_cpu2; > > > > > + > > > > > + hw_cpu1 = > > > get_hard_smp_processor_id(primary); > > > > > + hw_cpu2 = > > > get_hard_smp_processor_id(primary + > > > > > 1); > > > > > + set_hard_smp_processor_id(primary, > > > hw_cpu2); > > > > > + set_hard_smp_processor_id(primary + 1, > > > > > hw_cpu1); > > > > > + /* get new physical cpu id */ > > > > > + hw_cpu = get_hard_smp_processor_id(nr); > > > > > > > > NACK as discussed in http://patchwork.ozlabs.org/patch/454944/ > > > > > > > > -Scott > > > > > > You said, > > > > > > There's no need for this. I have booting from a thread1, and > > > having > > > it > > > kick its thread0, working locally without messing with the > > > hwid/cpu > > > mapping. > > > > > > I still have questions here. After a core reset, how can you boot > > > Thread1 > > > of the core first. As I know, Thread0 boots up first by default. > > > > So the issue isn't that thread1 comes up first, but that you *want* > > thread1 > > to come up first and it won't. I don't think this remapping is an > > acceptable > > answer, though. Instead, if you need only thread1 to come up, start > > the > > core, have thread0 start thread1, and then send thread0 into whatever > > waiting > > state it would be in if thread1 had never been offlined. > > > > -Scott > > Remapping is a concise solution. what's the harm of it? > Keeping things simple is good in my opinion. Remapping is not simple. Remapping will make debugging more complicated (I see an oops on CPU , which CPU's registers do I dump in the debugger?), could expose bugs where smp_processor_id() is used where hard_smp_processor_id() is needed, etc. Having thread0 start thread1 and then go wherever it would have gone if thread1 were up the whole time is much more straightforward. -Scott -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/