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: 5833001 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8DA299F373 for ; Mon, 16 Feb 2015 13:37:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C116120145 for ; Mon, 16 Feb 2015 13:37:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C485201F5 for ; Mon, 16 Feb 2015 13:37:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932142AbbBPNhD (ORCPT ); Mon, 16 Feb 2015 08:37:03 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:54807 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755671AbbBPNhC (ORCPT ); Mon, 16 Feb 2015 08:37:02 -0500 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>; 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 Cc: Stephen Boyd , Kyungmin Park , Marek Szyprowski , Krzysztof Kozlowski , stable@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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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