From patchwork Thu Feb 6 19:12:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 3597981 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 BA91DBF418 for ; Thu, 6 Feb 2014 19:15:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F2CCF20120 for ; Thu, 6 Feb 2014 19:15:29 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 0C8272011E for ; Thu, 6 Feb 2014 19:15:29 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBUOt-0006Dd-5p; Thu, 06 Feb 2014 19:14:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBUOe-0000j9-O9; Thu, 06 Feb 2014 19:14:00 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBUO8-0000cK-Qj for linux-arm-kernel@lists.infradead.org; Thu, 06 Feb 2014 19:13:31 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) 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 <0N0L00KYX9DP90A0@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 06 Feb 2014 19:13:01 +0000 (GMT) X-AuditID: cbfec7f5-b7fc96d000004885-2e-52f3dec114bf Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 8A.74.18565.1CED3F25; Thu, 06 Feb 2014 19:13:05 +0000 (GMT) Received: from AMDC1227.digital.local ([106.116.147.199]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N0L002UD9DPUJ50@eusync4.samsung.com>; Thu, 06 Feb 2014 19:13:05 +0000 (GMT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 01/12] ARM: EXYNOS: Do not resume l2x0 if not enabled before suspend Date: Thu, 06 Feb 2014 20:12:46 +0100 Message-id: <1391713977-22300-2-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.8.5.2 In-reply-to: <1391713977-22300-1-git-send-email-t.figa@samsung.com> References: <1391713977-22300-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e/4Nd2D9z4HGXTu4LD4O+kYu8XZZQfZ LHoXXGWzONv0ht1i0+NrrBYzzu9jslh75C67xanrn9ks1s94zeLA6fH71yRGj9kNF1k8Ni+p 97hyoonVo2/LKkaPz5vkAtiiuGxSUnMyy1KL9O0SuDK23v3DXPCds+L59E/sDYy9HF2MHBwS AiYSb8+7dTFyApliEhfurWfrYuTiEBJYyijRdnM/M4TTxyTR3raRBaSKTUBN4nPDIzYQW0RA VeJz2wJ2EJtZYDOTxJojTiC2sECkxKRjd8FqWIBqjmw4wgayjFfASaL7lizEXgWJ1deFQCo4 BZwl2ifsYAKxhYAq7l6+xz6BkXcBI8MqRtHU0uSC4qT0XCO94sTc4tK8dL3k/NxNjJBg+7qD cekxq0OMAhyMSjy8iis+BwmxJpYVV+YeYpTgYFYS4bW9AxTiTUmsrEotyo8vKs1JLT7EyMTB KdXAGJ1Z80OIryvSbJYH396jTXVTfgsuDHMKfn23hEHwl4sfb9a9nV0rZlZ/N7llLvL2/ue5 xh+eiPPuYumudelt5o71eyH42XRJtOC976vyn87zVFeK7t/8Stucb47apv339m3531jUWl1z Ynru/8JrB7aExUzxsDDx3FzRKsN4m1917+uPu3s5lViKMxINtZiLihMBsyH0+BQCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140206_141328_957284_C7F2398D X-CRM114-Status: UNSURE ( 8.08 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.4 (-------) Cc: Kukjin Kim , Arnd Bergmann , Tomasz Figa , Doug Anderson , Kyungmin Park , Olof Johansson , linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Trying to resume l2x0 if it was not enabled before suspend leads to system crash. This patch prevents this by checking if l2x0_regs_phys is a valid pointer to l2x0 context data saved on initialization. Signed-off-by: Tomasz Figa Acked-by: Kyungmin Park --- arch/arm/plat-samsung/s5p-sleep.S | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/plat-samsung/s5p-sleep.S b/arch/arm/plat-samsung/s5p-sleep.S index a030e73..20764bd 100644 --- a/arch/arm/plat-samsung/s5p-sleep.S +++ b/arch/arm/plat-samsung/s5p-sleep.S @@ -59,13 +59,15 @@ ENTRY(s3c_cpu_resume) and r0, r0, r1 ldr r1, =CPU_CORTEX_A9 cmp r0, r1 - bne resume_l2on + bne skip_l2_resume adr r0, l2x0_regs_phys ldr r0, [r0] + cmp r0, #0 + beq skip_l2_resume ldr r1, [r0, #L2X0_R_PHY_BASE] ldr r2, [r1, #L2X0_CTRL] tst r2, #0x1 - bne resume_l2on + bne skip_l2_resume ldr r2, [r0, #L2X0_R_AUX_CTRL] str r2, [r1, #L2X0_AUX_CTRL] ldr r2, [r0, #L2X0_R_TAG_LATENCY] @@ -78,7 +80,7 @@ ENTRY(s3c_cpu_resume) str r2, [r1, #L2X0_POWER_CTRL] mov r2, #1 str r2, [r1, #L2X0_CTRL] -resume_l2on: +skip_l2_resume: #endif b cpu_resume ENDPROC(s3c_cpu_resume)