Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755465AbbHFSDF (ORCPT ); Thu, 6 Aug 2015 14:03:05 -0400 Received: from mail-bl2on0105.outbound.protection.outlook.com ([65.55.169.105]:53816 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753000AbbHFSDC (ORCPT ); Thu, 6 Aug 2015 14:03:02 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=scottwood@freescale.com; Message-ID: <1438884172.2097.155.camel@freescale.com> Subject: Re: [PATCH 1/3] Powerpc: mpc85xx: refactor the PM operations From: Scott Wood To: Chenhui Zhao CC: , , , Tang Yuantian , "linuxppc-dev@lists.ozlabs.org" Date: Thu, 6 Aug 2015 13:02:52 -0500 In-Reply-To: <1438840466.23384.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> <1438633568.2097.35.camel@freescale.com> <1438769477.21522.0@remotesmtp.freescale.net> <1438829848.2097.129.camel@freescale.com> <1438834837.23384.0@remotesmtp.freescale.net> <1438839985.2097.151.camel@freescale.com> <1438840466.23384.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: DM2PR22CA0029.namprd22.prod.outlook.com (25.162.205.39) To BY1PR03MB1481.namprd03.prod.outlook.com (25.162.210.14) X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1481;2:rBrJI6Y54iVzSQeXwbQ7rfWzeQ5e4TE4wisyzr4h4r1FniUvYRP+XKohz7FQbqyPHiu29TY5NTMGGZddr9iW954QMoEQgqtMzesb9eatNlftDfkjDIkv6zM16YDjjeWrI5GYwgyWV8YXy+er2QB2cCFaE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MgQkXNSQ7eEDrdNdkZ8AV3UVFyzHBizyp7TuEdBmrzNsTG01RMYf9FEWe6pzR/rjF+dNnb3b2gcF0EP5unobn9q0X0y38NwoXYRrPdZpUq/jp0aPtTE7Xab+BwMSes98VcTxwaCzKSLROw3I9dQJvd8ridwvlYa6KHKd93B1nVCGOsUNkOkKe1pG5JTkGUz8fhpdu90fDavIm6KldL7E3a9y6uHw+fzmi5xUA7WTftGxwwb78Q6UtGf0io6dzpCtdCXoOSSzi0= 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)(377424004)(57704003)(24454002)(377454003)(199003)(189002)(19580405001)(4001540100001)(23676002)(81156007)(19580395003)(68736005)(40100003)(97736004)(106356001)(5001960100002)(5001860100001)(122386002)(5001830100001)(76176999)(105586002)(101416001)(5820100001)(64706001)(4001450100002)(47776003)(103116003)(87976001)(50466002)(33646002)(86362001)(42186005)(50986999)(36756003)(77096005)(92566002)(110136002)(2950100001)(93886004)(50226001)(77156002)(62966003)(46102003)(189998001)(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;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTFQUjAzTUIxNDgxOzIzOjNEQjMrd1BwT1hoSnpTU3VEZ3dsSndUaFdM?= =?utf-8?B?bFZvQkNqU05GZWFmZ1pKN3lrQ2piTnRmVlZWTDNUSDhiZ3YzQmRzMmxOL0c0?= =?utf-8?B?Y3NpK0Q1NldlUHJzMFFzaHhQSDVobEplOFRu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4R1Mc1L+a0W0jLdThyW9ODZ0r30mzPgC35ofzxjE4STeyM=;20:wpOpMLkAZ7AZrJXGPdFiEzqywnHHv2qKv1kq2rvkI4kQ2wYRUp0PLLd4VYeHJPS2XqxP0jEV+SJt/DjyC0F1hQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2015 18:02:59.0574 (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: 2694 Lines: 79 On Thu, 2015-08-06 at 13:54 +0800, Chenhui Zhao wrote: > On Thu, Aug 6, 2015 at 1:46 PM, Scott Wood > wrote: > > On Thu, 2015-08-06 at 12:20 +0800, Chenhui Zhao wrote: > > > On Thu, Aug 6, 2015 at 10:57 AM, Scott Wood > > > > > > wrote: > > > > On Wed, 2015-08-05 at 18:11 +0800, Chenhui Zhao wrote: > > > > > 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. > > > > > > > > Why would the MPIC be signalling those interrupts if they've been > > > > masked at > > > > the MPIC? > > > > > > > > -Scott > > > > > > > > > > The interrupts to RCPM from MPIC are IRQ, Machine Check, NMI and > > > Critical interrupts. Some of them didn't be masked in MPIC. > > > > What interrupt could actually happen to a sleeping cpu that this > > protects > > against? > > > > -Scott > > Not sure. Maybe spurious interrupts or hardware exceptions. Spurious interrupts happen due to race conditions. They don't happen because the MPIC is bored and decides to ring a CPU's doorbell and hide in the bushes. If by "hardware exceptions" you mean machine checks, how would such a machine check be generated by a core that is off? > However, setting them make sure dead cpus can not be waked up unexpectedly. I'm not seeing enough value here to warrant resurrecting the old sleep node stuff. -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/