Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754220AbbHGDTl (ORCPT ); Thu, 6 Aug 2015 23:19:41 -0400 Received: from mail-bl2on0147.outbound.protection.outlook.com ([65.55.169.147]:17600 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752545AbbHGDTj (ORCPT ); Thu, 6 Aug 2015 23:19:39 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; lists.ozlabs.org; dkim=none (message not signed) header.d=none; Date: Fri, 7 Aug 2015 11:19:32 +0800 From: Chenhui Zhao Subject: Re: [PATCH 1/3] Powerpc: mpc85xx: refactor the PM operations To: Scott Wood CC: , , , Tang Yuantian , "linuxppc-dev@lists.ozlabs.org" Message-ID: <1438917572.2431.0@remotesmtp.freescale.net> In-Reply-To: <1438884172.2097.155.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> <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> 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;BN1BFFO11FD049;1:Y+AqVEBv4zrYBnRb8RWMl2bi9qJz03TvEprskVZ8DS7Zzm1lnGAq8oOWLTNNCl4Q0SK2P8c17ux+f1rRxVu2gZ67wx4MiAQUNnjLlkbgxxLxu1/uozLIbxG3QPyhpxjDkidKpAsPsmRhjmRM6gq9g/5W1EfYoyT3v+riYXOBY3Tw77/aZvOENLS/JMOgjSHr1bPIkGjvpYNAKJo1+AnMfaWkn4CiMYQR6ZzSTik1QjjFlIE9Ye1Q0vf/Bz7/GDjcJ9EwxGyaxVogeUQ6VLD8incfXGsrCx17REjUf0GCnt1tdXHjGOzFxrUv/tVh1iXoLjb8bsCpkn6hp2mkRAabqw== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(24454002)(377424004)(189002)(199003)(377454003)(57704003)(110136002)(5001960100002)(92566002)(4001450100002)(2950100001)(105606002)(81156007)(4001540100001)(5001830100001)(104016003)(189998001)(5001860100001)(88526003)(106466001)(62966003)(97736004)(77156002)(50226001)(87936001)(93886004)(50986999)(19580395003)(86362001)(19580405001)(6806004)(68736005)(85426001)(64706001)(69596002)(23676002)(77096005)(47776003)(46102003)(50466002)(76176999);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR03MB574;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DM2PR03MB574;2:p7MUAxd+4YbEQuAbeVEp1Sr4lbZ7Njihfilt/cxHlzkvh8HW2zhRpjpe7np/kZT+ezxFngMm6o0nNzyayRuNemmrXiBdEpjH4leLqqUzLQVler3oEOa3o55al+MADFYqBmExoDc9y3j7UKgh6Yy6AtQ2NtGrebXGETrWLItxahw=;3:fEHLe7V5bsVFptXZ7aiwToMXoNVKo3t6U6HdhUnd36A18h+LZQ/gcFXoZguRldg1ltZFIpd21QKcszJI48064loeNfE/SfppEwzjdugwatFfzej1pNSKnyfxZz+aZnbrquXHXmq4lW+GMFteK21wt1wcxVq7jEpCybocGE1h3B0rBAwLV2L/fqd8QFh5Wmxx6WznjSUxKV36iMX8cPYTlFNViHihWyh5Uh8Px5VqxmA=;25:aDdAIlUGxzMDMsSjPWVyv8qBWbxQ0oBkAzK47nvFNv5OFzu526rPBUVqNOE8sCsdpzjt5L3oxFfSAjfIZskE8WFYSNNZY8W+wXSmhAMFG4Xz76W5gPOQPnfRAXR5SSS0pCroOMZKS2KUtpxWgCqtZYzwTx0VERAldXvZOsHDUboUk8Zw1rohT92iARHweEdVEwLLIzKyWPqpLDLUzPbGdhHQBW5FrlwImORtNmTfftxcS08hjNrkFhKKD9y9oWr8 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB574; X-Microsoft-Exchange-Diagnostics: 1;DM2PR03MB574;20:JPjfy6i9C0mFT9+4qazHomjErKNMJbILR1ops7zer/eobjMvl+HVM2S71KGTE4qe8jjsT70+LZHxTaravaWltmzMV2IN/5mSztpgZk/pEOqoAknKwUDSA/iKSIx27tIHA08E2oV5BniGbF+K+s+1N71iXtq6I907z/XBRWyB1D4rN6X6Gdl4loEN6+8YEtg5jrXBEM+EhmVSwOVjIu0vZq+5SoNVha4pWpg2tjXA/g7u885U/SlqJO6s9QUH62qoDFgYPo/+OybLF3nXxHJOc17k4JfcH5POzQfku/lhsfTzZUTOjBRhlpHv5dzMQiYmrACHbNT5Qx6UiPXhSk93GDmNRoopzUy1dMz3XYoKl+c=;4:JOeJLJRSrxwqPZNxDA9FN2qJSMGYt0kk7/HzRl6BeNP57bxrJC9HFnhDiuixf2dfQ3TCXWKGk3+CuPlkZc+NgnAjZFJBWZjoxN73bmvCM7uLehu882LHTj4Rl0bNPBQpuyoMScC1LHTAXwD1zCG5nC+i3oOVdj97YJJJ2BrSF3eQ8/uHUOTluTmZQdoK36AU03Iw390SIIvnbMfmzGcQQb6oRQU72eWpqnYpstt1MOYNEb8esAoyHQvefMSsrFHh2AAv+12ITDOu7/11IrKpizvv4D8uIO/FgKdEBuKT7iU= 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:DM2PR03MB574;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB574; X-Forefront-PRVS: 066153096A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==;24:N/bq++NCOis3sr4kfFRDcvevBbGczNi93G/C2vQZ4IwyrYYUB1FSJyZf/jPCc4Nhx43Zj/qq9T6VHGGB2skDnwVhYVcK+4HI3QQDYktIMoE=;20:Rp3HbHriwlvo9P4d5OUZQ8MPQqmcd7IPmNGPWkRLIJS9Zzx09c7Idh0UOPzWZCp/sS+z6unZehLx/4Nf1CVuUQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2015 03:19:36.0239 (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: DM2PR03MB574 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3175 Lines: 103 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. -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/