Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755517AbbHCU0W (ORCPT ); Mon, 3 Aug 2015 16:26:22 -0400 Received: from mail-by2on0114.outbound.protection.outlook.com ([207.46.100.114]:10428 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754599AbbHCU0V (ORCPT ); Mon, 3 Aug 2015 16:26:21 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=scottwood@freescale.com; Message-ID: <1438633568.2097.35.camel@freescale.com> Subject: Re: [PATCH 1/3] Powerpc: mpc85xx: refactor the PM operations From: Scott Wood To: Chenhui Zhao CC: , , , Tang Yuantian , Tang Yuantian Date: Mon, 3 Aug 2015 15:26:08 -0500 In-Reply-To: <1438601578.7515.2@remotesmtp.freescale.net> References: <1438334444-31919-1-git-send-email-b29983@freescale.com> <1438387178.19345.77.camel@freescale.com> <1438601578.7515.2@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: BY2PR07CA054.namprd07.prod.outlook.com (10.141.251.29) To BLUPR03MB1476.namprd03.prod.outlook.com (25.163.81.18) X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB1476;2:lSTj9wFO9xlyxKsNCxTRZHvdnTmrA84qExQ4G6BeyvfO4IM6Au9oeSsUn4Ku3Tt16PJ0eWXVZnKxj47i90XCtEE3qK7MjmesQ1Hjiar2EDgiZJ/QoUhhA/pyGrOYLNnDPAoTLYnd41MNoQxx+oMyhL/AnM7pmo0bHtcxxJcTECc=;3:3rpkySmgjSzVr2WwMWzjUowwgKF6RXn1yN4a15yXk1Ld6N3z/WT3/P8h21ReG9Dxh9LGR7nj/RbwBpcUTi7lEDLOG8b2N6wy9ts76/S8iqBLHfGjOj9GacEj5m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XKx+hsZNqTuxTldTMpJA712UipSKBar8o1mHDZLQZsDn04JSU9vDyH6oEWYlA9NGpcTD3KJiRtB7iK674pET+mHeOvghFAi+q1/tQKJR24KT6zsVj2qVYQn2UxSM4euIenp7y7djWz2XOsqsPEK68= 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:BLUPR03MB1476;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1476; X-Forefront-PRVS: 0657D528EC X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(24454002)(377454003)(57704003)(189002)(377424004)(110136002)(189998001)(92566002)(76176999)(106356001)(36756003)(4001450100002)(46102003)(5001960100002)(87976001)(101416001)(50986999)(86362001)(33646002)(5001860100001)(103116003)(77096005)(105586002)(97736004)(47776003)(68736005)(5820100001)(64706001)(2950100001)(122386002)(19580395003)(4001540100001)(50226001)(5001830100001)(23676002)(42186005)(19580405001)(50466002)(62966003)(77156002)(81156007)(40100003)(99106002)(3826002)(5001840100002);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB1476;H:[IPv6:2601:448:8100:f9f:12bf:48ff:fe84:c9a0];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjAzTUIxNDc2OzIzOkFlZHUyakMxbkZ1UHJRN2FSZmZkYzZRS0Zx?= =?utf-8?B?dDFoQmpwWVVvUVpBZ3psUUJHS1lncm5MSkgvREFLeUJadkFSaHJZY1BhbHJ0?= =?utf-8?B?SFJWTWVCa0tqKzhSYnBnUnBMbnBpODZJRitqRFVQT2VRYlc4SHJJRmtUS1Bs?= =?utf-8?B?cGVVRURWOXR5WnQySDlPMVlRN0pvZGxYQ0IwN3BwbHN4R1pMS3pBTStGL0Z0?= =?utf-8?B?OGxIUWVMY1RIaURCQlBrU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g: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2015 20:26:17.7702 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1476 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2030 Lines: 57 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? > > @@ -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 -- 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/