Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754887AbbHAAWa (ORCPT ); Fri, 31 Jul 2015 20:22:30 -0400 Received: from mail-bl2on0102.outbound.protection.outlook.com ([65.55.169.102]:37248 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751093AbbHAAWV (ORCPT ); Fri, 31 Jul 2015 20:22:21 -0400 Authentication-Results: freescale.com; dkim=none (message not signed) header.d=none; Message-ID: <1438388531.19345.88.camel@freescale.com> Subject: Re: [PATCH 3/3] PowerPC/mpc85xx: Add hotplug support on E6500 cores From: Scott Wood To: CC: , , Tang Yuantian , Chenhui Zhao , Tang Yuantian Date: Fri, 31 Jul 2015 19:22:11 -0500 In-Reply-To: <1438334444-31919-3-git-send-email-b29983@freescale.com> References: <1438334444-31919-1-git-send-email-b29983@freescale.com> <1438334444-31919-3-git-send-email-b29983@freescale.com> 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: BY2PR21CA0036.namprd21.prod.outlook.com (25.162.74.174) To CY1PR03MB1486.namprd03.prod.outlook.com (25.163.17.16) X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB1486;2:xGeeO5BvfoHGofxPz2F+U0KIe9VlO7g+W1sAwFQSdPyV9He4PunUGpaVu+hnXtpVxpRcvrCBoLeGgvgRlvZPaXVmKymUVRXaMb8UfZQFn+z41W2eYVa15Fj09aiYSNzanJGGDGwGmH1bSEYyB2KaBf+KLb02VVHKDke3hqtyIcg=;3:FpCoARkiG9XISB+PxsamHC9eiySowW3v6YSVELX25fwGFkHIUAWFMt6aeQRi+W4MhPyvPtLQ190xj3lsMLr32JE1Q+W7jleFnVyRJOFfksIIk7asw5zfygpIWdQu0823lcqfWXTtGCemoFG7jVnpDA==;25:na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algzYVCfu6jKUBdxX0ss8BNAq8Gno2i26pYWPtmVGB//c23ZzHx1eD6I/tlWK+iF4wo+67ooOhhOJwISSkecBfvNXiZsgeI2ewCOFWd2+CwXLDqiYVB3Y= 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:CY1PR03MB1486;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1486; X-Forefront-PRVS: 0655F9F006 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(377424004)(24454002)(50986999)(62966003)(76176999)(2371004)(5820100001)(77156002)(2950100001)(15975445007)(36756003)(77096005)(40100003)(4001450100002)(122386002)(50466002)(110136002)(5001960100002)(86362001)(575784001)(33646002)(189998001)(92566002)(47776003)(19580395003)(46102003)(103116003)(50226001)(2351001)(19580405001)(23676002)(42186005)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR03MB1486;H:[IPv6:2601:448:8100:f9f:12bf:48ff:fe84:c9a0];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB1486;23:mZDDE59QIKoOfV1JnVqbpzXDVOgCAspk3vTOmSCvofmXVwN1VUFw52Cy11TX7EbvzxT6z5U812Z4GPqt0ztPdv6ubftBrfzHQ8lS41OPXqF0DTRm57s3QW+pnHzmlhaXosV25rF3IsmbOi5i/igyZ0UadBjV8ZwowVLtZP4knLc7wtB2HIim16A8Svryv1JqVi2dt4dOazst1nSXDQajAbV2lkIJRPuxVlHimq/ET7xXVZWEZGNvtuzMVl900wKvVgH+DYrdU41/PjkdYqtM/viSsSg+fN1IxLkyxmJXe7CsjCJsQ2TfEXFXOSlxTtJzZz4PVC2cDfYnYI5/8yk1xhd1aHdOBvRWPhpK5fRwLa3cJXmPq1BCj3NGzhIRTSRn0gVZ1VFJ3ReBuPkDYSR/8qMRXALbOLcRmfS6Sls4zkECcC3DBa3uhdZJz1H8TWa3OKa3tz6FT5nJuBVJfqOnGv/HJg3RI/I5pBYON9wVqDtWYayLenqowH7/l71xvNQD+YONscZgAO4J/531Z8mjUui7UKZnZB/fbfXXx2B1oU4y7E4oDllECBxR6aYZyR0FWBblMWmlwbc4EP26JzF75SY209d+oRXdFxD6UgyxXyOuD6FZcLXNHvNPy5QLDek5kkDySETNNBG1L9NSP5BunBuubHPbl7A/CxABVSUbKgKfCaM6lgtVYNKBSc+W+A01f4d9Aub/x7RqDmI3Bm13mxpgqRJz9UMFsfy2IuFHhMoiQ/Lnny/XMIMvx1O4jGDK6RKCXclHAyWRgl6ZjN2bG59JqSS8IwRcKtAE+bkX6TW+ozwlnDnezmzQfaUshyyhuKiH6JVVaTvMuoCiFzhT/B5j/HK/ZnlBffmsFwvB2JYHJUTABs+rq5kk0Rt5FMRWIPprwV2fTEYC1+lrZ8LUvmjKo1fc9NisdeiCwKTwdH8= X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB1486;5:ku6RKNILsvsVSXvOKCjA/by+85BSORMBtm/DmZM7eYNiV5pB5ozpJqGshhidMvRK7yGPDdOvOFyAUzyUGNKvlst/qUXOfocjBbRemqQOXxo0v1/2VI4sjOmxLnILAZ+eDsaNtuIX+6bYKDerfvxGNg==;24:fHCHD8iaH63TBNY5j4kw1MCO65DOaNacyM+ab7IQncENMOa1lbADmitKF4KSrBHfhnGwrGcpfDtUHxL07mcD8g0l8ChbIOgSyqAQjLlO4+Y=;20:PVy8f830fKea4LteSDJKzUvylIm1I2JoBsO+OM8X9NZov1k1WHghIkZ/yO+BeVkaj9MH1CPXduakG/qEssAqQQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2015 00:22:18.6948 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1486 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2486 Lines: 65 On Fri, 2015-07-31 at 17:20 +0800, b29983@freescale.com wrote: > diff --git a/arch/powerpc/platforms/85xx/smp.c > b/arch/powerpc/platforms/85xx/smp.c > index 7f0dadb..8652a49 100644 > --- a/arch/powerpc/platforms/85xx/smp.c > +++ b/arch/powerpc/platforms/85xx/smp.c > @@ -189,15 +189,22 @@ static inline u32 read_spin_table_addr_l(void > *spin_table) > static void wake_hw_thread(void *info) > { > void fsl_secondary_thread_init(void); > - unsigned long imsr1, inia1; > + unsigned long imsr, inia; > int nr = *(const int *)info; > - > - imsr1 = MSR_KERNEL; > - inia1 = *(unsigned long *)fsl_secondary_thread_init; > - > - mttmr(TMRN_IMSR1, imsr1); > - mttmr(TMRN_INIA1, inia1); > - mtspr(SPRN_TENS, TEN_THREAD(1)); > + int hw_cpu = get_hard_smp_processor_id(nr); > + int thread_idx = cpu_thread_in_core(hw_cpu); > + > + booting_cpu_hwid = (u32)hw_cpu; Unnecessary cast. Please explain why you need booting_cpu_hwid. > + imsr = MSR_KERNEL; > + inia = *(unsigned long *)fsl_secondary_thread_init; > + if (thread_idx == 0) { > + mttmr(TMRN_IMSR0, imsr); > + mttmr(TMRN_INIA0, inia); > + } else { > + mttmr(TMRN_IMSR1, imsr); > + mttmr(TMRN_INIA1, inia); > + } > + mtspr(SPRN_TENS, TEN_THREAD(thread_idx)); Please rebase this on top of http://patchwork.ozlabs.org/patch/496952/ > + /* > + * 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 -- 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/