Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751956AbbHEK00 (ORCPT ); Wed, 5 Aug 2015 06:26:26 -0400 Received: from mail-by2on0138.outbound.protection.outlook.com ([207.46.100.138]:31872 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750794AbbHEK0Y (ORCPT ); Wed, 5 Aug 2015 06:26:24 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; feescale.com; dkim=none (message not signed) header.d=none; Date: Wed, 5 Aug 2015 18:11:17 +0800 From: Chenhui Zhao Subject: Re: [PATCH 1/3] Powerpc: mpc85xx: refactor the PM operations To: Scott Wood CC: , , , Tang Yuantian , Tang Yuantian Message-ID: <1438769477.21522.0@remotesmtp.freescale.net> In-Reply-To: <1438633568.2097.35.camel@freescale.com> References: <1438334444-31919-1-git-send-email-b29983@freescale.com> <1438387178.19345.77.camel@freescale.com> <1438601578.7515.2@remotesmtp.freescale.net> <1438633568.2097.35.camel@freescale.com> X-Mailer: geary/0.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD027;1:9HvKNmotnBP6KW2CR1vItAV5AqO0pMAj8OW9s0SLNqcMlPxZQq3ukvHc5vYTX1CsjWGo1TG67j76rkcE2XIxJ71sXndN51M5RitOsNqwkc5yCagwieEcS6mj1vWnXnXLgGhUXVhZjD9bl+LqFnTwiJL/H78Svh3yH5TODYbeVzlnRBDXbVe45rCXTyNQqFX12ebTuIVrpfKdrCn0K/pIPBlY52bw5lQkDp3IEdomo0va+IxRdFfnu+ax8mvEeRRgyGEkO8V2PHxdXRw553HeIeUiZQkmjA7wFmuAvpCv7yagS2/d2iwZi00dQ0SxU4z0n35zZyjrPqgW0e7kEJbgCg== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(57704003)(24454002)(377454003)(377424004)(189002)(4001540100001)(87936001)(47776003)(5001860100001)(50226001)(110136002)(64706001)(76176999)(189998001)(50986999)(81156007)(97736004)(19580395003)(46102003)(92566002)(5001830100001)(5001960100002)(106466001)(4001450100002)(88526003)(23676002)(19580405001)(77096005)(86362001)(105606002)(2950100001)(93886004)(62966003)(69596002)(6806004)(85426001)(50466002)(104016003)(77156002)(68736005);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR03MB562;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB562;2:1jAwKIBOLI7Yb81bd2Ai/qJc6PVDO2bKA2IR+GxyiIhM8jpqxLkPcJZlSn60Ycc454t6Ek64MgPnz83sz0qKhr3T5+CJJnJ67LCkoBD5k/saAnuSKhI0bgcg1fKErRiSioR/G3GwZk/3HcAeeKFKWUOTmL3qGyoDCfGV8IA9dTg=;3:bj/8KvtN0hIkj+F4Bw24G0cN/VyBXeZPk6Aq92n1bPNPr23EP6xbWN0FV7K3267Hsw+EBIEhGzMnL18VIign/JNONdl1ODtM8rK9dsBOAmlYjLo3T3mY/GfeaSbqmJYSjDd2seCJBIlIjXI0sc6K0GkEGOf0hhyUdRAyrTG/IP0Klu3W8WRDd0asKQ36M1T67U2o+Mo2FNaD0iQZe4UWGQ+elrd7NPJT+FBfycX7c1g=;25:7y1N+uIAJ5hZ/rSNBg8eC4U+4YwAQ233yl2vm6gzMHAGcFtlCWaehhlXZIvvUJzBaKCLp1b9gDjlUJNWUzwaMoZu9chFR8Znx5GNsG1ZRP7MgJxiPmt68dMrDe82DmRxM8Xtg4MiZu9h9XMHL/nNiCD/wB/Udwx79MLq3wjqzdb6dPaD7ppSKRj1jxhPA4mtMmlekaNYUGtykLy+b466uLMnMn9dN9BwdqC0MmbTMZXR40dYd7rp/IQbaa9GhllMDvb4iIjBKhYwTtpdjo4ajg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB562; X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB562;20:9RBD1qgcSLFAwJAFNqq+24wQVrqm0xayIteh2xk1GH6a8YjGPitDLq2sg1Ctlqskk0xK7vcNALT5LghNUwPv02qJvxt0bWLU52IV09E7gX6CWBdm6Gj9e0mwKURELXljjLl2g8bDowZE7LJxVAryksydSxUzWJRfVc/ITCPxlx7mzLUTJbSaBlXG/ti9VqxMPZcblY4XwuAKTnO+F0o/JnPDlBayiVinSHuNCMijRfOzCLtvtoXEITO7vZI4D2IlQrwi4R4Ng15PswimHkAoDAvw+OCj1TX+j3zylfAEXD0AxKpBr2KQyKBn6Bx6ANOTXcuoI3czBg9E9LAFaOn+8bdmJ+PXRHXjfYgGC+bf+Dg=;4:knbrVUV7mXRB4VYIaTgMB5Zpb7hSCjoGPm5zVRyAXhEJTX2pt0JNslG12PSKyVqo0NDFrS4ujmVFaZ13tef2nfeWkI60srb036H6ihOJlJ8M48RZ6YRi4238psVipAy9/UbApQUT4/q+PuHviUne583LRNnNEwPTBkQgUV/2Wzac5rttSO1cLHT5vDxHgC9/6uywyI+n/ElpKROIx0QjRXSzazkFwCWdbt3SGCsiuow9LEV/FisUoUE650vBgJONViOhik04ijSVmZ7oaZwJ8wL2araSCsrWxBnQFchKBi0= 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:BL2PR03MB562;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB562; X-Forefront-PRVS: 06592CCE58 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTDJQUjAzTUI1NjI7MjM6czFHR2JCRkNzS1U0dkVPbXUxS3RVSTVWcDVo?= =?utf-8?B?M1dPeS9xYjFMdllpWnJjT0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89DzTiTm4hZKLXjO+CG0B0xcdhIwBGjvxQlIA8vwajRn+WHdZOg2pU3qA3eg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2015 10:11:21.0205 (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.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB562 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2398 Lines: 76 On Tue, Aug 4, 2015 at 4:26 AM, Scott Wood wrote: > On Mon, 2015-08-03 at 19:32 +0800, Chenhui Zhao wrote: >> > > >> On Sat, Aug 1, 2015 at 7:59 AM, Scott Wood >> wrote: > >> > >> > Could you explain irq_mask()? Why would there still be IRQs >> destined >> > for >> > this CPU at this point? >> >> This function just masks irq by setting the registers in RCPM (for >> example, RCPM_CPMIMR, RCPM_CPMCIMR). Actually, all irqs to this CPU >> have been migrated to other CPUs. > > So why do we need to set those bits in RCPM? Is it just caution? Setting these bits can mask interrupts signalled to RCPM from MPIC as a means of waking up from a lower power state. So, cores will not be waked up unexpectedly. > >> > @@ -431,21 +415,9 @@ void __init mpc85xx_smp_init(void) >> > > smp_85xx_ops.probe = NULL; >> > > } >> > > >> > > - np = of_find_matching_node(NULL, mpc85xx_smp_guts_ids); >> > > - if (np) { >> > > - guts = of_iomap(np, 0); >> > > - of_node_put(np); >> > > - if (!guts) { >> > > - pr_err("%s: Could not map guts node >> > > address\n", >> > > - >> > > __func__); >> > > - return; >> > > - } >> > > - smp_85xx_ops.give_timebase = >> mpc85xx_give_timebase; >> > > - smp_85xx_ops.take_timebase = >> mpc85xx_take_timebase; >> > > #ifdef CONFIG_HOTPLUG_CPU >> > > - ppc_md.cpu_die = smp_85xx_mach_cpu_die; >> > > + ppc_md.cpu_die = qoriq_cpu_dying; >> > > #endif >> > >> > Shouldn't you make sure there's a valid qoriq_pm_ops before >> setting >> > cpu_die()? Or make sure that qoriq_cpu_dying() works regardless. >> > >> > -Scott >> >> This patch is just for e500v2. The following patches will handle the >> case of e500mc, e5500 and e6500. > > What stops a user from trying to use cpu hotplug on unsupported cpus, > or in a > virtualized environment, and crashing here? > > -Scott Will set these callback functions only if qoriq_pm_ops is valid. -Chenhui -- 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/