From patchwork Mon Feb 16 13:36:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5833021 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BCBF1BF440 for ; Mon, 16 Feb 2015 13:39:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED3392012D for ; Mon, 16 Feb 2015 13:39:14 +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 2A6E320123 for ; Mon, 16 Feb 2015 13:39:14 +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 1YNLre-00070T-7k; Mon, 16 Feb 2015 13:37:30 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YNLrZ-0006rg-67 for linux-arm-kernel@lists.infradead.org; Mon, 16 Feb 2015 13:37:26 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NJV00FTFA0FRI40@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 16 Feb 2015 13:41:03 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-ea-54e1f1ea080d Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 8E.4C.07834.AE1F1E45; Mon, 16 Feb 2015 13:34:34 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NJV00MAM9TJIV60@eusync1.samsung.com>; Mon, 16 Feb 2015 13:36:59 +0000 (GMT) From: Krzysztof Kozlowski To: Russell King , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: EXYNOS: Don't use LDREX and STREX after disabling cache coherency Date: Mon, 16 Feb 2015 14:36:42 +0100 Message-id: <1424093802-5488-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAJMWRmVeSWpSXmKPExsVy+t/xy7qvPj4MMVi+hcfi9QtDi/7Hr5kt zja9YbfY9Pgaq8XlXXPYLGac38dkcfsyr8XaI3fZLX6c6WaxWLDxEaMDl0dLcw+bx+W+XiaP Tas62Tw2L6n36NuyitHj8ya5ALYoLpuU1JzMstQifbsErozFz3wKFnBVnFy8i7GB8SpHFyMn h4SAicS8g2eZIGwxiQv31rN1MXJxCAksZZS41zKNFcLpY5K4cOk8M0gVm4CxxOblS8CqRAQ2 M0r0N+4Gq2IWOMMocbxzMiNIlbBApMT8E1tYQGwWAVWJW98/sIHYvAJuEnt+PWGH2CcncfLY ZNYJjNwLGBlWMYqmliYXFCel5xrqFSfmFpfmpesl5+duYoSE0pcdjIuPWR1iFOBgVOLh3RD2 IESINbGsuDL3EKMEB7OSCO+y9w9DhHhTEiurUovy44tKc1KLDzEycXBKNTA2l1e+3JO09vGH OWyhKj4hxplS7bl5lVMLKj8dOOvVbnYrY69YVBazjfX6hGy7oMufle9nx/08HvGv12vi+U+f q5U1Yrn3cl+6cLH0mV1CtPSRouy8nWw+/AdKpWTLY22rWFp2rGSWYltrV2oT1z1pxe9jz2I9 j3M76ujGcE2snnNNXGhVohJLcUaioRZzUXEiAH5Zz4ADAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150216_053725_377951_2C650727 X-CRM114-Status: GOOD ( 10.38 ) X-Spam-Score: -4.9 (----) Cc: Kyungmin Park , Stephen Boyd , Krzysztof Kozlowski , stable@vger.kernel.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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 During CPU shutdown the exynos_cpu_power_down() is called after disabling cache coherency and it uses LDREX and STREX instructions (by calling of_machine_is_compatible() -> kobject_get() -> kref_get()). The LDREX and STREX should not be used after disabling the cache coherency so just use soc_is_exynos(). Signed-off-by: Krzysztof Kozlowski Fixes: adc548d77c22 ("ARM: EXYNOS: Use MCPM call-backs to support S2R on exynos5420") Cc: Reported-by: Stephen Boyd Reviewed-by: Stephen Boyd --- arch/arm/mach-exynos/platsmp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 7a1ebfeeeeb8..0abb7dff73ab 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -126,8 +126,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious) */ void exynos_cpu_power_down(int cpu) { - if (cpu == 0 && (of_machine_is_compatible("samsung,exynos5420") || - of_machine_is_compatible("samsung,exynos5800"))) { + if (cpu == 0 && (soc_is_exynos5420() || soc_is_exynos5800())) { /* * Bypass power down for CPU0 during suspend. Check for * the SYS_PWR_REG value to decide if we are suspending