Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751473AbdL0AyI (ORCPT ); Tue, 26 Dec 2017 19:54:08 -0500 Received: from mail-he1eur01on0040.outbound.protection.outlook.com ([104.47.0.40]:25134 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751211AbdL0AyH (ORCPT ); Tue, 26 Dec 2017 19:54:07 -0500 From: Peng Fan To: Dong Aisheng CC: Shawn Guo , "A.s. Dong" , "linux-kernel@vger.kernel.org" , Russell King , Fabio Estevam , Sascha Hauer , "van.freenix@gmail.com" , "linux-arm-kernel@lists.infradead.org" Subject: RE: [PATCH] arm: imx: suspend/resume: use outer_disable/resume Thread-Topic: [PATCH] arm: imx: suspend/resume: use outer_disable/resume Thread-Index: AQHTca+I9uQpoIijsECS1wrrCngHnKNVb/AAgAAJzaCAAASEAIAAAZ9QgAADGgCAAPMuEA== Date: Wed, 27 Dec 2017 00:54:00 +0000 Message-ID: References: <20171210120718.15197-1-peng.fan@nxp.com> <20171226091230.GP23070@X250> <20171226100344.GA11724@b29396-OptiPlex-7040> <20171226102038.GB11724@b29396-OptiPlex-7040> In-Reply-To: <20171226102038.GB11724@b29396-OptiPlex-7040> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-originating-ip: [92.121.68.129] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2639;7:7PmYNKY4SuGqhShMkGsIZ4MxDGb2xX9xYzFePqPpREwXbHVXNv14oBOCAiKzU3VlbC4lQmYYPsoxbgRu2UJCE7u9r8oBAZnrsMgaV4wzu+SHTmF0gB5o97hl5T5QXmevoZTSyewMAmdd6BW8X+MPwmADDu9jzjg+7uLo1NsOOlKBVJgGwV/3bje4sGccOpvdxS51WtwKOuvkOphysUcAjbKDVInym7dm+LIoqIai9gDHdeJ/EfsUu7L9UJlXphsA x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10009020)(346002)(39860400002)(39380400002)(376002)(366004)(396003)(13464003)(51914003)(189003)(199004)(24454002)(5250100002)(39060400002)(2906002)(15650500001)(53936002)(86362001)(6246003)(4326008)(25786009)(478600001)(1411001)(106356001)(54906003)(66066001)(93886005)(105586002)(97736004)(2900100001)(316002)(33656002)(81156014)(8676002)(74316002)(76176011)(3280700002)(2950100002)(59450400001)(7736002)(305945005)(3660700001)(5660300001)(6436002)(6916009)(55016002)(229853002)(81166006)(99286004)(7696005)(14454004)(8936002)(6116002)(9686003)(3846002)(68736007)(102836004)(6506007)(53546011);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2639;H:DB6PR04MB3221.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 6bad0e10-bc00-4af3-c412-08d54cc4522d x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060);SRVR:VI1PR0401MB2639; x-ms-traffictypediagnostic: VI1PR0401MB2639: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197)(258649278758335); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(3231023)(944501075)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041268)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:VI1PR0401MB2639;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:VI1PR0401MB2639; x-forefront-prvs: 0534947130 x-microsoft-antispam-message-info: zJMQZEg62QIqX02oD0PWZvGvI0SvMQJsVv5YcP9cTgE3GmkP6nm3Of4QkG/A0J742ayOhr/CSiMwm/2TtLD9RA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bad0e10-bc00-4af3-c412-08d54cc4522d X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2017 00:54:01.7731 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2639 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id vBR0sDtt015556 Content-Length: 5198 Lines: 144 > -----Original Message----- > From: Dong Aisheng [mailto:dongas86@gmail.com] > Sent: Tuesday, December 26, 2017 6:21 PM > To: Peng Fan > Cc: Shawn Guo ; A.s. Dong ; > linux-kernel@vger.kernel.org; Russell King ; Fabio > Estevam ; Sascha Hauer ; > van.freenix@gmail.com; linux-arm-kernel@lists.infradead.org > Subject: Re: [PATCH] arm: imx: suspend/resume: use outer_disable/resume > > On Tue, Dec 26, 2017 at 10:11:41AM +0000, Peng Fan wrote: > > > > Hi Aisheng, > > > > > -----Original Message----- > > > From: Dong Aisheng [mailto:dongas86@gmail.com] > > > Sent: Tuesday, December 26, 2017 6:04 PM > > > To: Peng Fan > > > Cc: Shawn Guo ; A.s. Dong > > > ; linux-kernel@vger.kernel.org; Russell King > > > ; Fabio Estevam ; > > > Sascha Hauer ; van.freenix@gmail.com; > > > linux-arm-kernel@lists.infradead.org > > > Subject: Re: [PATCH] arm: imx: suspend/resume: use > > > outer_disable/resume > > > > > > On Tue, Dec 26, 2017 at 09:49:01AM +0000, Peng Fan wrote: > > > > Hi Shawn > > > > > > > > > -----Original Message----- > > > > > From: Shawn Guo [mailto:shawnguo@kernel.org] > > > > > Sent: Tuesday, December 26, 2017 5:13 PM > > > > > To: Peng Fan > > > > > Cc: A.s. Dong ; > > > > > linux-kernel@vger.kernel.org; Russell King > > > > > ; Fabio Estevam ; > > > > > Sascha Hauer ; van.freenix@gmail.com; > > > > > linux-arm- kernel@lists.infradead.org > > > > > Subject: Re: [PATCH] arm: imx: suspend/resume: use > > > > > outer_disable/resume > > > > > > > > > > On Sun, Dec 10, 2017 at 08:07:18PM +0800, Peng Fan wrote: > > > > > > Use outer_disable/resume for suspend/resume. > > > > > > With the two APIs used, code could be simplified and easy to > > > > > > extend to introduce l2c_write_sec for i.MX platforms when > > > > > > moving Linux Kernel runs in non-secure world. > > > > > > > > > > > > Signed-off-by: Peng Fan > > > > > > Cc: Shawn Guo > > > > > > Cc: Sascha Hauer > > > > > > Cc: Fabio Estevam > > > > > > Cc: Russell King > > > > > > Cc: Dong Aisheng > > > > > > > > > > Changed 'arm: ' prefix to 'ARM: ', and applied patch. > > > > > > > > I just tested it on 6sx-sdb, seems this patch breaks 6sx. Could > > > > you first drop this patch? I'll send out v2 fix the 6sx issue soon. > > > > > > > > > > Yes, i tested mx6ul/mx6sl ok but mx6sx sdb failed. > > > > Thanks for the test. > > > > > > > > After a few debug, it seems you removed the l2c310_early_resume in > > > v7_cpu_resume which is shared between lower power idle and suspend. > > > > > > Current only mx6sx/mx6ul supports low power idle in upstream, but > > > mx6ul is > > > A7 with internal L2, that's probably why only mx6sx showed the issue. > > > > > > I did the following quick try to restore L2 after exit lower power > > > idle, but still can meet occasional crash during booting. > > > > > > diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c b/arch/arm/mach- > > > imx/cpuidle-imx6sx.c index c5a5c3a..edce5bd 100644 > > > --- a/arch/arm/mach-imx/cpuidle-imx6sx.c > > > +++ b/arch/arm/mach-imx/cpuidle-imx6sx.c > > > @@ -26,7 +26,7 @@ static int imx6sx_idle_finish(unsigned long val) > > > * to adding conditional code for L2 cache type, > > > * just call flush_cache_all() is fine. > > > */ > > > - flush_cache_all(); > > > +// flush_cache_all(); > > > > I think flush_cache_all is still needed, to flush L1 data, right? > > > > I thought it will be done in generic cpu_suspend. > See: __cpu_suspend_save() > > So we still need it? After remove flush_cache_all, seems 6sx-sdb suspend/resume and low power idle both works. Alought __cpu_suspend_save flush data, my understanding is there is chance to cache data/inst before "wfi". Then we better keep flush_cache_all here? Thanks, Peng. > > > Regards > Dong Aisheng > > > cpu_do_idle(); > > > > > > return 0; > > > @@ -49,7 +49,9 @@ static int imx6sx_enter_wait(struct cpuidle_device > *dev, > > > cpu_pm_enter(); > > > cpu_cluster_pm_enter(); > > > > > > + outer_disable(); > > > cpu_suspend(0, imx6sx_idle_finish); > > > + outer_resume(); > > > > Yes, this is in my V2 patch. > > > > > > > > cpu_cluster_pm_exit(); > > > cpu_pm_exit(); > > > > > > As this changed the order to L2 restore and cpu resume, so i'm not > > > quite sure if lower power idle still requres L2 restore before CPU > > > resume or something else we're missing. > > > > In low power idle, L2 may also lose power, so outer_disable/resume is > needed, I think. > > > > Thanks, > > Peng. > > > > > > > > Regards > > > Dong Aisheng > > > > > > > Thanks, > > > > Peng. > > > > > > > > > > > > > > Shawn