Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbdLJMIO (ORCPT ); Sun, 10 Dec 2017 07:08:14 -0500 Received: from mail-db5eur01on0066.outbound.protection.outlook.com ([104.47.2.66]:7968 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751720AbdLJMIL (ORCPT ); Sun, 10 Dec 2017 07:08:11 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; From: Peng Fan To: shawnguo@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, van.freenix@gmail.com, Peng Fan , Sascha Hauer , Fabio Estevam , Russell King , Dong Aisheng Subject: [PATCH] arm: imx: suspend/resume: use outer_disable/resume Date: Sun, 10 Dec 2017 20:07:18 +0800 Message-Id: <20171210120718.15197-1-peng.fan@nxp.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [185.114.77.231] X-ClientProxiedBy: HK2P15301CA0009.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::19) To HE1PR04MB3225.eurprd04.prod.outlook.com (2603:10a6:7:1b::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83241fa8-a92a-40f4-5e7c-08d53fc6a9b2 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307);SRVR:HE1PR04MB3225; X-Microsoft-Exchange-Diagnostics: 1;HE1PR04MB3225;3:T1vW5S/EOQoHn5dpU5KGtQofC4/WizyoUv8A5lEVaky9qrCMh7ky0bpdthQCE2TjMZFfJx7+0jUIExLfkbJbdofqtVxN18zBEEs1ZEc5llE0zpZ/hsOVC7z2jVFNsjT1tP+f0cbSnKDAZ6l04/cs2O55FAbQeHqebS1l1bW8043R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dNpEZ7DLs3a31jqbJbVFHIXaXsMgSy3yyf0kQGoWW6vG2ndDeVDS4YucdHR9ZvhZOn22Da8sEQLAS6D1UjNzJFIKpDNayPRXEk/89pKPzMfOCUXxOnObHBrs7Zfvovm97IfF86iy9hHm9rbQuFVN+lfOb4mXvxITc8KPi0wp7slS9M2cabjGrEQ2SCf+;4:fUpgTYgnMNQhHRHACXiSYQ3IOGIlo8EC9PV+WbBbjyLXu1d8ITAMX9QJPndTiuX8bp+FNWPb8L56rcFZJeZqMOyPzCY68F800188L+/maSfyNQXk5A6R/0Zp7UuHUu1Z9M6Y7bfEuO13vcuAnGxVNfqo6AwSkFgJuFzHsQgK01m6Mgwj6MraltxTq6hSTO2QL+58APJRWbwvqKfSzQ2Tf7eTRYEih0h6MQhX9h6fJq03Wgm5t/DXAtyLBKc1vKPNpn8JtjGzFzMGQjJAbOtsjKn4BfHheoZ1/8QDMk/+D0AFx5i6Xnz93jmKtaSrrEgG X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231022)(6055026)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:HE1PR04MB3225;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:HE1PR04MB3225; X-Forefront-PRVS: 05177D47DC X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(346002)(376002)(39860400002)(199004)(189003)(81166006)(81156014)(39060400002)(1076002)(68736007)(305945005)(7736002)(15650500001)(54906003)(8676002)(97736004)(2351001)(25786009)(4326008)(2361001)(33646002)(316002)(106356001)(2906002)(575784001)(86362001)(50226002)(105586002)(16586007)(8936002)(5660300001)(66066001)(47776003)(6116002)(478600001)(36756003)(52116002)(50466002)(6506006)(48376002)(51416003)(3846002)(6486002)(6916009)(6666003)(6512007)(16526018)(53936002)(59450400001);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR04MB3225;H:linux-u7w5.ap.freescale.net;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR04MB3225;23:bXKVDPQrnVJxo69ORYY8xrlorZzVUGvC+0UXzazmH?= =?us-ascii?Q?oxOoBGzPoG5aSWmqaiWknDaZr1cdufPbHAufbNud2Z3cngTu28Na8PQ8O36x?= =?us-ascii?Q?FpLGHFbx9tOZRQGz5qmMrCZu72cXF5CZWri0yeYYbHD0ZMhlHSdqDGdODAst?= =?us-ascii?Q?bJxu97xR/3HRUWAkKM+TFKzG12oYO6t68NsqthcJjBUZdYOj0p4kNeTu2F5F?= =?us-ascii?Q?G+KCBLKDYS5dJ3+1yKQC9/Z8G8IPBhSkP7is3Vr11/8OObj0Zs9Rl53CdfRE?= =?us-ascii?Q?YpULIN4mvAOnK5N7ZnX78XBSmRtWOUw8A5TxF6+z3jKRavyZFP/EhrFBTBpN?= =?us-ascii?Q?PQ5Hyoy0R7904JKhLyPg1k+uMyVlOlGXSKhfXILNaWmMj5v3jGhD8BC6KFtL?= =?us-ascii?Q?XPX+wiWfi0FGTfAbnZWrWaHsfvefTKSvJlwwJbIQ2ul8/vYXPs8LDUOMh7aL?= =?us-ascii?Q?mgvXovPQK6Y+vaw4HZ1Y4URC3YaqEOPF+y3uPkLcAJzTHn0zjSnr+4RdUuJG?= =?us-ascii?Q?KP3Tduwf1fbVnqSfnmyHj7AO2JJsjdtlcQBr75EK252e6E5Ze60Tr3Qa6Vl+?= =?us-ascii?Q?QCm+hfsC1mBQ1Jkcg3mDAnCtSXmkR+Z2JHlspmIfi6jKWPcpj3+KsNjhZW3B?= =?us-ascii?Q?B89Oj9yTiUbsRAh2TZZvSQ5tZVcPRuaK0ZcWxay9yRF00y2ZlmbKITjvU1g3?=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Q0oWJMnaqaPCr6buYeGMk2Y5ur8m8hhXzzC45tchQrqWWaSn+x8gVMmTx6PZ1KfvE3s7iH88uSad0OTPl29k8=;24:mwIs5U/a9Y2VjYwzEuyKIXqQ2cVkfTyJA2U3YLH5g0v1eeXjjEQpgrSAsRd+dIuIHgE/3vDdmHb1r+Zfiw+6YTca/n6rc82iVHJ+ZcE7SyU=;7:n6L4lvGm4v0USrusb9PUlR9JlZlz6FVn+pURHCsnaEfjF7hb5ylbGWLGVdn6ddQKBTsa0I9B8SWmBgKgDBWzJmpbAUS5pJrMbCg9aUhu03J2VS/Agzz7dxHGoPzxQY1gRtnHvgm+4Z6/l5QZrs9c1Rfc8TxxgfP1xNsesMqK3J2Icy8gIRJQ56QrF8OInVkl+f3lzIFz7fu8U+c37aEXxEu3+/WlecCv/1GHi7GohC7qMnBVuU9F9FkHy52IJ+Up SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2017 12:07:55.8562 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83241fa8-a92a-40f4-5e7c-08d53fc6a9b2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3225 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2192 Lines: 81 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 --- arch/arm/mach-imx/pm-imx6.c | 2 ++ arch/arm/mach-imx/suspend-imx6.S | 24 ------------------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index ecdf071653d4..153a0afc7645 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c @@ -392,8 +392,10 @@ static int imx6q_pm_enter(suspend_state_t state) imx6_enable_rbc(true); imx_gpc_pre_suspend(true); imx_anatop_pre_suspend(); + outer_disable(); /* Zzz ... */ cpu_suspend(0, imx6q_suspend_finish); + outer_resume(); if (cpu_is_imx6q() || cpu_is_imx6dl()) imx_smp_prepare(); imx_anatop_post_resume(); diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S index 76ee2ceec8d5..324f6b165e82 100644 --- a/arch/arm/mach-imx/suspend-imx6.S +++ b/arch/arm/mach-imx/suspend-imx6.S @@ -74,24 +74,6 @@ .align 3 - .macro sync_l2_cache - - /* sync L2 cache to drain L2's buffers to DRAM. */ -#ifdef CONFIG_CACHE_L2X0 - ldr r11, [r0, #PM_INFO_MX6Q_L2_V_OFFSET] - teq r11, #0 - beq 6f - mov r6, #0x0 - str r6, [r11, #L2X0_CACHE_SYNC] -1: - ldr r6, [r11, #L2X0_CACHE_SYNC] - ands r6, r6, #0x1 - bne 1b -6: -#endif - - .endm - .macro resume_mmdc /* restore MMDC IO */ @@ -185,9 +167,6 @@ ENTRY(imx6_suspend) str r9, [r11, #MX6Q_SRC_GPR1] str r1, [r11, #MX6Q_SRC_GPR2] - /* need to sync L2 cache before DSM. */ - sync_l2_cache - ldr r11, [r0, #PM_INFO_MX6Q_MMDC_V_OFFSET] /* * put DDR explicitly into self-refresh and @@ -342,8 +321,5 @@ ENDPROC(imx6_suspend) ENTRY(v7_cpu_resume) bl v7_invalidate_l1 -#ifdef CONFIG_CACHE_L2X0 - bl l2c310_early_resume -#endif b cpu_resume ENDPROC(v7_cpu_resume) -- 2.14.1