Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946573AbbHHAOD (ORCPT ); Fri, 7 Aug 2015 20:14:03 -0400 Received: from mail-bn1bon0110.outbound.protection.outlook.com ([157.56.111.110]:29344 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1946435AbbHHAOA (ORCPT ); Fri, 7 Aug 2015 20:14:00 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=scottwood@freescale.com; Message-ID: <1438992828.2097.211.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: Fri, 7 Aug 2015 19:13:48 -0500 In-Reply-To: <1438917572.2431.0@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> <1438884172.2097.155.camel@freescale.com> <1438917572.2431.0@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: SN2PR10CA0041.namprd10.prod.outlook.com (25.160.12.179) To BY1PR03MB1484.namprd03.prod.outlook.com (25.162.210.142) X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1484;2:Po1ul8p4QEzzghsRz9pviZEhUwQAMJ1cCQNWJIvMjHCTdmhb1AM51ofsDVCc2gqGZ1SGEQpCTuzKOsPcTinVQrGlZD8f496IXp8K8b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;4:YZv3cVZ37ZhPf+AQpGqAhNWah0wkkvTfN3ksthHAgxU1dntBHfCLqtHFDbX5eONBD5/Fyr5ufuX7Cg3sd4VSM1g7M/d9jTAsuymsO4Smee72jZPosA93J54ThH9OmqOof2e/CzPXmi0eOgzv7VEPJWa9ArNn3TXlMBxCXfScqIZ//02MIFndVz6weqvisUaGavObrxYMj1nZarvLeZ8dHkj7jBDKy4VayA+muEl8cnZkRxxg+S+2tqu6ZJfqnk+Zvg6E65UQgNM+8nD+l6NkCIJECp4xY3T5flEiNphEvQ8= 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:BY1PR03MB1484;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1484; X-Forefront-PRVS: 06628F7CA4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(377424004)(24454002)(57704003)(199003)(189002)(40100003)(122386002)(5001960100002)(87976001)(42186005)(110136002)(5001860100001)(50466002)(5820100001)(77096005)(2950100001)(189998001)(97736004)(68736005)(5001830100001)(81156007)(77156002)(62966003)(4001540100001)(105586002)(64706001)(93886004)(76176999)(19580405001)(92566002)(33646002)(19580395003)(36756003)(50226001)(103116003)(23676002)(50986999)(106356001)(4001450100002)(86362001)(101416001)(47776003)(46102003)(99106002)(3826002)(5001840100002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1484;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?MTtCWTFQUjAzTUIxNDg0OzIzOm5vODlRdzc3MEFvT0Z3KzEzR2NneDBHbkRo?= =?utf-8?B?ZXlnNTFQZXRrRXNuaEQzb3Q1cTcrNWhEVGhhaXNad002NmhaTUlQcXlSSHNx?= =?utf-8?B?VFRp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99ZdwJ9pRTbClmNPMAA9zGV3dPRIBWQfYDIK1p85ie4+KatbqnlT3ZguD664N08/zna5It3cQr9tkjY=;20:1/p98390tYaJeAWSlmtdR+1Xb3P+TA7JhcLfINn7rj8cW+TyPFapLB2yk1+BmoAqyv9MbvWmJVLt9FHYCw+HVA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2015 00:13:55.1934 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1484 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3569 Lines: 103 On Fri, 2015-08-07 at 11:19 +0800, Chenhui Zhao wrote: > On Fri, Aug 7, 2015 at 2:02 AM, Scott Wood > wrote: > > 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 > > My guess maybe not accurate. My point is that electronic parts don't > always work as expected. Taking preventative measures can make the > system more robust. In addition, this step is required in deep sleep > procedure. The deep sleep part is more convincing -- so MPIC masking is not effective during deep sleep? -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/