Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753349AbbDCCyR (ORCPT ); Thu, 2 Apr 2015 22:54:17 -0400 Received: from mail-bn1bbn0109.outbound.protection.outlook.com ([157.56.111.109]:27676 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753241AbbDCCyN convert rfc822-to-8bit (ORCPT ); Thu, 2 Apr 2015 22:54:13 -0400 From: "chenhui.zhao@freescale.com" To: Scott Wood CC: "linuxppc-dev@lists.ozlabs.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Jason.Jin@freescale.com" Subject: Re: [3/4] powerpc: support CPU hotplug for e500mc, e5500 and e6500 Thread-Topic: [3/4] powerpc: support CPU hotplug for e500mc, e5500 and e6500 Thread-Index: AQHQa1d3oqTE1K1/J0mvKoXOI5CL2p05ij4AgABcJACAALEVng== Date: Fri, 3 Apr 2015 02:54:08 +0000 Message-ID: <1428029650867.38904@freescale.com> References: <1427365095-26396-3-git-send-email-chenhui.zhao@freescale.com> ,<20150331020722.GC5667@home.buserror.net> <1427973405260.57477@freescale.com>,<1427990598.22867.271.camel@freescale.com> In-Reply-To: <1427990598.22867.271.camel@freescale.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [199.59.231.64] authentication-results: lists.ozlabs.org; dkim=none (message not signed) header.d=none; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1295; x-microsoft-antispam-prvs: x-forefront-antispam-report: BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(51704005)(24454002)(377424004)(122556002)(2900100001)(77156002)(62966003)(2950100001)(36756003)(40100003)(46102003)(19580395003)(19580405001)(86362001)(66066001)(106116001)(110136001)(117636001)(99286002)(50986999)(54356999)(76176999)(87936001)(2656002)(102836002)(92566002)(77096005);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB1295;H:BY2PR03MB396.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:DM2PR0301MB1295;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1295; x-forefront-prvs: 05352A48BE Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2015 02:54:08.6352 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB1295 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4233 Lines: 104 ________________________________________ From: Wood Scott-B07421 Sent: Friday, April 3, 2015 0:03 To: Zhao Chenhui-B35336 Cc: linuxppc-dev@lists.ozlabs.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Jin Zhengxiong-R64188 Subject: Re: [3/4] powerpc: support CPU hotplug for e500mc, e5500 and e6500 On Thu, 2015-04-02 at 06:16 -0500, Zhao Chenhui-B35336 wrote: > > ________________________________________ > From: Wood Scott-B07421 > Sent: Tuesday, March 31, 2015 10:07 > To: Zhao Chenhui-B35336 > Cc: linuxppc-dev@lists.ozlabs.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Jin Zhengxiong-R64188 > Subject: Re: [3/4] powerpc: support CPU hotplug for e500mc, e5500 and e6500 > > On Thu, Mar 26, 2015 at 06:18:14PM +0800, chenhui zhao wrote: > > @@ -189,16 +193,14 @@ _GLOBAL(fsl_secondary_thread_init) > > isync > > > > /* > > - * Fix PIR to match the linear numbering in the device tree. > > - * > > - * On e6500, the reset value of PIR uses the low three bits for > > - * the thread within a core, and the upper bits for the core > > - * number. There are two threads per core, so shift everything > > - * but the low bit right by two bits so that the cpu numbering is > > - * continuous. > > Why are you getting rid of this? If it's to avoid doing it twice on the > same thread, in my work-in-progress kexec patches I instead check to see > whether BUCSR has already been set up -- if it has, I assume we've > already been here. > > [chenhui] I didn't delete the branch prediction related code. I didn't say you did. I'm saying that you can check whether BUCSR has been set up, to determine whether PIR has already been adjusted, if your concern is avoiding running this twice on a thread between core resets. If that's not your concern, then please explain. [chenhui] If no need to change PIR in CPU hotplug, I will change the code as you mentioned. > > + /* > > + * 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. > > + */ > > What if the core is not in a PM state that requires a reset? > Where does this reset occur? > > [chenhui] Reset occurs in the function mpic_reset_core(). > > > + 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); > > Why are you swapping the hard smp ids? > > [chenhui] For example, Core1 has two threads, Thread0 and Thread1. In normal boot, Thread0 is CPU2, and Thread1 is CPU3. > But, if CPU2 and CPU3 are all off, user wants CPU3 up first. we need to call Thread0 as CPU3 and Thead1 as CPU2, considering > the limitation, after core is reset, only Thread0 is up, then Thread0 kicks up Thread1. 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. [chenhui] Great. If you have completed your patches, can we merge our code? > > @@ -252,11 +340,7 @@ static int smp_85xx_kick_cpu(int nr) > > spin_table = phys_to_virt(*cpu_rel_addr); > > > > local_irq_save(flags); > > -#ifdef CONFIG_PPC32 > > #ifdef CONFIG_HOTPLUG_CPU > > - /* Corresponding to generic_set_cpu_dead() */ > > - generic_set_cpu_up(nr); > > - > > Why did you move this? > > [chenhui] It would be better to set this after CPU is really up. Please make it a separate patch with an explanation. -Scott [chenhui] OK. -- 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/