From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752343AbcHZFKB (ORCPT ); Fri, 26 Aug 2016 01:10:01 -0400 Received: from mail-db5eur01on0078.outbound.protection.outlook.com ([104.47.2.78]:36256 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751990AbcHZFJ7 (ORCPT ); Fri, 26 Aug 2016 01:09:59 -0400 From: Yongcai Huang To: Peter Chen CC: "linux-arm-kernel@lists.infradead.org" , lkml , Fabio Estevam , "shawnguo@kernel.org" , "linux@armlinux.org.uk" , "kernel@pengutronix.de" Subject: RE: [PATCH] ARM: imx: add cpuidle support for i.mx6ul Thread-Topic: [PATCH] ARM: imx: add cpuidle support for i.mx6ul Thread-Index: AQHR/eE+V5MD3QsHDkuO1zUdVYKUrKBZQz4AgAFV+xA= Date: Fri, 26 Aug 2016 03:33:58 +0000 Message-ID: References: <1472055231-28434-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: 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=anson.huang@nxp.com; x-originating-ip: [199.59.226.141] x-ms-office365-filtering-correlation-id: b0e4da1b-efbf-41aa-3e96-08d3cd61d0c4 x-microsoft-exchange-diagnostics: 1;DB6PR0402MB2742;6:lM8zEjslZXoPKIwCnZbcbYiFNjZZYafNCJt9gQKZK3v4K43Oq0Ygj2vWxTuAvWoEL5QCX7vjApjCRRltBL4FXBrh2tJQGtTzdW5jUpB/wdrLiUo73jImrF6kQHVZKyeeFVbt0KvIuUm1R7x3uul45YNNN0ChsIHaUBC0VStQsKj25ybuGuSJE6WY+x8TGf/UZfK5ltKGfXGtVN2krP9DATMUHYVwR/6OhytqQV0JrUUyBbytAXPgP51V6VDU0iG1sei8RKv6eTS7P7WMTTq7ksr7eYiXnMD+dXTlv8KiDIUbTr3lNubesa92os1XRAx7iKATi1l4HpNdAa28eW+SIg==;5:1IZdjoKwTapyvyJ284RBxZAHRKI9KIhZHsxdO7VAIKAq8e4ac86SgHG5Sd1j4njqxljXGFCLz3QzOtpscRk1FU/IO24Em7FqPPtp2ZBZuY2iKdOMVjzGJjizJbiXdDrjgs2anWG2YvPPaK94NYq2RA==;24:WR6YyK5O2pG9ziw9lcII6w5sNcrteBIe+UItCLwPgRhgjhDf/7O+tR6i3iN7HndTxHBKS3Ab6z7DXySrRmUgVWUeeA38QS5N6FsSmGP8chE=;7:IM48DMtrsFTSKK9AaTQ2oJDkN0zaGBkcvm862o+hLrnr1Phy+T7UIyD+Jhv8ZJOi0NyMQ5+IaYaMKFcQRlPCsdNaOA4pcqMP8INKKkPz8a0ZojtfwNou/G3QM9wB3OXvoUf+LKRLL0kuPJfrFdzEy/MHR5eMiLlPu4j4qwj4oi53MNfZlzP85roSMMaUABIbk6unaqpX7DtUmXoCPpF02mSvpwOS/hskIg0VeeN0Z0O2zrWmrW+csw9CQVDpg65K x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0402MB2742; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197)(258649278758335); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026);SRVR:DB6PR0402MB2742;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0402MB2742; x-forefront-prvs: 00462943DE x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(377424004)(199003)(377454003)(13464003)(3660700001)(54356999)(1411001)(106356001)(105586002)(86362001)(5002640100001)(586003)(92566002)(106116001)(305945005)(76176999)(3280700002)(7736002)(7696003)(7846002)(74316002)(189998001)(50986999)(9686002)(102836003)(3846002)(68736007)(97736004)(110136002)(2906002)(2900100001)(2950100001)(81156014)(33656002)(5660300001)(81166006)(87936001)(77096005)(15975445007)(8676002)(8936002)(19580395003)(66066001)(19580405001)(1720100001)(11100500001)(122556002)(76576001)(4326007)(6116002)(101416001)(10400500002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0402MB2742;H:DB5PR04MB1320.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Aug 2016 03:33:58.6064 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2742 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 base64 to 8bit by mail.home.local id u7Q5A6Un008583 Best Regards! Anson Huang > -----Original Message----- > From: Peter Chen [mailto:hzpeterchen@gmail.com] > Sent: 2016-08-25 3:09 PM > To: Yongcai Huang > Cc: linux-arm-kernel@lists.infradead.org; lkml ; > Fabio Estevam ; shawnguo@kernel.org; > linux@armlinux.org.uk; kernel@pengutronix.de > Subject: Re: [PATCH] ARM: imx: add cpuidle support for i.mx6ul > > > > > Signed-off-by: Anson Huang > > --- > > arch/arm/mach-imx/cpuidle-imx6sx.c | 10 ++++++++++ > > arch/arm/mach-imx/mach-imx6ul.c | 3 +++ > > 2 files changed, 13 insertions(+) > > > > diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c > > b/arch/arm/mach-imx/cpuidle-imx6sx.c > > index 41cdce6..b4fcc8ae 100644 > > --- a/arch/arm/mach-imx/cpuidle-imx6sx.c > > +++ b/arch/arm/mach-imx/cpuidle-imx6sx.c > > @@ -9,14 +9,21 @@ > > #include > > #include > > #include > > +#include > > +#include > > #include > > #include > > > > #include "common.h" > > #include "cpuidle.h" > > > > +static bool pl310_available; > > + > > > > static int imx6sx_idle_finish(unsigned long val) { > > + /* check if need to flush internal L2 cache */ > > + if (!pl310_available) > > Just wondering why you need an extra variable here? > Calling of_find_compatible_node takes long time at that time? > > Peter > Because cpu idle enter/exit is called very frequently, so calling of_find_compatible_node in every cpu idle thread is adding too many latency, I think adding a variable is better. Anson > > + flush_cache_all(); > > cpu_do_idle(); > > > > return 0; > > @@ -101,5 +108,8 @@ int __init imx6sx_cpuidle_init(void) > > imx_gpc_set_arm_power_up_timing(2, 1); > > imx_gpc_set_arm_power_down_timing(1, 1); > > > > + if (of_find_compatible_node(NULL, NULL, "arm,pl310-cache")) > > + pl310_available = true; > > + > > return cpuidle_register(&imx6sx_cpuidle_driver, NULL); } diff > > --git a/arch/arm/mach-imx/mach-imx6ul.c > > b/arch/arm/mach-imx/mach-imx6ul.c index c2cd61c..9c5e8f3 100644 > > --- a/arch/arm/mach-imx/mach-imx6ul.c > > +++ b/arch/arm/mach-imx/mach-imx6ul.c > > @@ -16,6 +16,7 @@ > > #include > > > > #include "common.h" > > +#include "cpuidle.h" > > > > static void __init imx6ul_enet_clk_init(void) { @@ -80,6 +81,8 @@ > > static void __init imx6ul_init_irq(void) > > > > static void __init imx6ul_init_late(void) { > > + imx6sx_cpuidle_init(); > > + > > if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { > > imx6_pm_opp_init(); > > platform_device_register_simple("imx6q-cpufreq", -1, > > NULL, 0); > > -- > > 1.9.1 > > > > > > _______________________________________________ > > linux-arm-kernel mailing list > > linux-arm-kernel@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel