From patchwork Wed Jun 25 11:52:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 4419881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DB3C1BEEAA for ; Wed, 25 Jun 2014 11:56:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 100C720384 for ; Wed, 25 Jun 2014 11:56:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6737020396 for ; Wed, 25 Jun 2014 11:56:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wzlm4-0001er-5H; Wed, 25 Jun 2014 11:54:00 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wzlm1-0001cD-06 for linux-arm-kernel@lists.infradead.org; Wed, 25 Jun 2014 11:53:57 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N7Q000313OUDOB0@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 25 Jun 2014 12:53:18 +0100 (BST) X-AuditID: cbfec7f4-b7fac6d000006cfe-c8-53aab83d67b0 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 29.E8.27902.D38BAA35; Wed, 25 Jun 2014 12:53:33 +0100 (BST) Received: from AMDC1227.digital.local ([106.116.147.199]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N7Q006ZH3P7BQ90@eusync3.samsung.com>; Wed, 25 Jun 2014 12:53:33 +0100 (BST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 5/6] ARM: EXYNOS: Fix suspend/resume sequences Date: Wed, 25 Jun 2014 13:52:55 +0200 Message-id: <1403697175-13476-1-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.9.3 In-reply-to: <1403618235-19353-1-git-send-email-t.figa@samsung.com> References: <1403618235-19353-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrKJMWRmVeSWpSXmKPExsVy+t/xq7q2O1YFG/Q2Glqs+atk0bvgKpvF psfXWC0u75rDZjHj/D4mi7VH7rJbrJ/xmsVi1a4/jA4cHjtn3WX32Lyk3qNvyypGj8+b5AJY orhsUlJzMstSi/TtErgy1j1dxljwla/iw+o1LA2Mf7i7GDk5JARMJK6dbmGBsMUkLtxbz9bF yMUhJLCUUWL1vt3MEE4fk8T5txMZQarYBNQkPjc8YgOxRQRUJT63LWAHKWIWmMokcWXzA1aQ hLCAo8Tv5sVMIDYLUNG5qbfBbF4BJ4lDy86wQ6yTk+jd9oYZxOYUcJbY2b4NrFcIqOb/ySam CYy8CxgZVjGKppYmFxQnpeca6hUn5haX5qXrJefnbmKEBNWXHYyLj1kdYhTgYFTi4Q3gWRUs xJpYVlyZe4hRgoNZSYS3fgNQiDclsbIqtSg/vqg0J7X4ECMTB6dUA2P+RfNZSq6J5f1/pph9 lLqcvb3s0LqHSXp5M7jXrLS9GsiZt634j4p2fvmkm04+tl4ts588fCIa99lw2ZdlLx6Z2Xe8 erNmw55LR39u2zZvCue6yEcP5Cbe7ey3uFm60syu3Jt9w8FYlv88Dxe51Go+vjL/wJ55b4/y HZf7EHaa9/yRMM3U2lV3lViKMxINtZiLihMB+N7QFAgCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140625_045357_196097_D0D193A4 X-CRM114-Status: GOOD ( 11.13 ) X-Spam-Score: -5.0 (-----) Cc: Abhilash Kesavan , Kukjin Kim , Tomasz Figa , Tomasz Figa , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Due to recent consolidation of Exynos suspend and cpuidle code, some parts of suspend and resume sequences are executed two times, once from exynos_pm_syscore_ops and then from exynos_cpu_pm_notifier() and thus it breaks suspend, at least on Exynos4-based boards. This patch fixes the issue by removing exynos_pm_syscore_ops completely and making the code rely only on CPU PM notifier. Tested on Exynos4210-based Trats board. Signed-off-by: Tomasz Figa --- arch/arm/mach-exynos/pm.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) Changes since v1: - rebased onto Kukjin's fixes branch. diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 202ca73..f23cc77 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -364,11 +364,6 @@ early_wakeup: return; } -static struct syscore_ops exynos_pm_syscore_ops = { - .suspend = exynos_pm_suspend, - .resume = exynos_pm_resume, -}; - /* * Suspend Ops */ @@ -438,22 +433,13 @@ static int exynos_cpu_pm_notifier(struct notifier_block *self, switch (cmd) { case CPU_PM_ENTER: - if (cpu == 0) { - exynos_pm_central_suspend(); - if (read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9) - exynos_cpu_save_register(); - } + if (cpu == 0) + exynos_pm_suspend(); break; case CPU_PM_EXIT: - if (cpu == 0) { - if (read_cpuid_part_number() == - ARM_CPU_PART_CORTEX_A9) { - scu_enable(S5P_VA_SCU); - exynos_cpu_restore_register(); - } - exynos_pm_central_resume(); - } + if (cpu == 0) + exynos_pm_resume(); break; } @@ -478,6 +464,5 @@ void __init exynos_pm_init(void) tmp |= ((0xFF << 8) | (0x1F << 1)); __raw_writel(tmp, S5P_WAKEUP_MASK); - register_syscore_ops(&exynos_pm_syscore_ops); suspend_set_ops(&exynos_suspend_ops); }