From patchwork Tue Apr 22 14:18:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leela Krishna Amudala X-Patchwork-Id: 28820 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 70B7620341 for ; Tue, 22 Apr 2014 14:19:25 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf24016766qcq.4 for ; Tue, 22 Apr 2014 07:19:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=qkn5Psc7F4mlFBDCTU9vgW5uQsEc+SG7PeGVLVeNh+k=; b=fPayge0KUMt9Jr8sDw7hk2LJUo2kaiwfaqdGbUY8vVplvOMGvrFai66iL18IXdHv1n M8ye1iHo0eHewdLWrhTar63UKaS3kyYG3rTWoQbhp5sa6LU7e9zM1COCV3i1w2Ldo0EU Ep7INIpeLSumW1h/0NbFwbnk06/BhiqyxYyOWhx0Dyxa6diL1ycb0AMQsZ06jd7Ru2Vk zBmdTfP2Y+P1Hciljcn4J7NGNotLPWAWeMAObR/YVsJXF+Sys+EUPyPdGDaOd4H6X7+J yyYNUiRpYvPSFxfXJyGWrT4UkXceZYCVy+bRNmCMx+9+hJZfmHLGprpoJRViXrmB9R6O CmWw== X-Gm-Message-State: ALoCoQl4/BTbyh3fe6oUfaXQnGfdQKou+0p2CzWG6djeO+4dW90V3KHMfnksBfpYBNg4Ai25enC5 X-Received: by 10.236.38.231 with SMTP id a67mr20279347yhb.17.1398176365105; Tue, 22 Apr 2014 07:19:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.106 with SMTP id o97ls93378qgd.50.gmail; Tue, 22 Apr 2014 07:19:25 -0700 (PDT) X-Received: by 10.221.62.131 with SMTP id xa3mr37310890vcb.13.1398176364989; Tue, 22 Apr 2014 07:19:24 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id ls10si6924773vec.10.2014.04.22.07.19.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 07:19:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id ib6so2624605vcb.41 for ; Tue, 22 Apr 2014 07:19:24 -0700 (PDT) X-Received: by 10.220.2.142 with SMTP id 14mr57846vcj.48.1398176364897; Tue, 22 Apr 2014 07:19:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp28317vcb; Tue, 22 Apr 2014 07:19:23 -0700 (PDT) X-Received: by 10.66.159.233 with SMTP id xf9mr9676084pab.139.1398176313533; Tue, 22 Apr 2014 07:18:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si22964678pbl.130.2014.04.22.07.18.32; Tue, 22 Apr 2014 07:18:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756630AbaDVOSP (ORCPT + 26 others); Tue, 22 Apr 2014 10:18:15 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:44803 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756571AbaDVOSA (ORCPT ); Tue, 22 Apr 2014 10:18:00 -0400 Received: by mail-pa0-f44.google.com with SMTP id bj1so5010076pad.31 for ; Tue, 22 Apr 2014 07:17:59 -0700 (PDT) X-Received: by 10.66.189.226 with SMTP id gl2mr44631906pac.65.1398176260829; Tue, 22 Apr 2014 07:17:40 -0700 (PDT) Received: from lk-linux.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id ph1sm202759237pac.14.2014.04.22.07.17.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 07:17:39 -0700 (PDT) From: Leela Krishna Amudala To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: daniel.lezcano@linaro.org, kgene.kim@samsung.com, amit.kucheria@linaro.org Subject: [PATCH] ARM: EXYNOS: cpu hotplug: use v7_exit_coherency_flush macro for cache disabling Date: Tue, 22 Apr 2014 19:48:00 +0530 Message-Id: <1398176280-7258-1-git-send-email-leela.krishna@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leela.krishna@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Remove the duplicated code for cache disabling and use "v7_exit_coherency_flush" macro to do the same job. Signed-off-by: Leela Krishna Amudala Acked-by: Nicolas Pitre --- cpu hotplug is tested with 3.15-rc1 on Origen(which has cortex A9) and Arndale octa(which has cortex A7 and A15) boards. arch/arm/mach-exynos/hotplug.c | 56 ++-------------------------------------- 1 file changed, 2 insertions(+), 54 deletions(-) diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c index 5eead53..9eb8d1b 100644 --- a/arch/arm/mach-exynos/hotplug.c +++ b/arch/arm/mach-exynos/hotplug.c @@ -24,56 +24,6 @@ #include "common.h" #include "regs-pmu.h" -static inline void cpu_enter_lowpower_a9(void) -{ - unsigned int v; - - asm volatile( - " mcr p15, 0, %1, c7, c5, 0\n" - " mcr p15, 0, %1, c7, c10, 4\n" - /* - * Turn off coherency - */ - " mrc p15, 0, %0, c1, c0, 1\n" - " bic %0, %0, %3\n" - " mcr p15, 0, %0, c1, c0, 1\n" - " mrc p15, 0, %0, c1, c0, 0\n" - " bic %0, %0, %2\n" - " mcr p15, 0, %0, c1, c0, 0\n" - : "=&r" (v) - : "r" (0), "Ir" (CR_C), "Ir" (0x40) - : "cc"); -} - -static inline void cpu_enter_lowpower_a15(void) -{ - unsigned int v; - - asm volatile( - " mrc p15, 0, %0, c1, c0, 0\n" - " bic %0, %0, %1\n" - " mcr p15, 0, %0, c1, c0, 0\n" - : "=&r" (v) - : "Ir" (CR_C) - : "cc"); - - flush_cache_louis(); - - asm volatile( - /* - * Turn off coherency - */ - " mrc p15, 0, %0, c1, c0, 1\n" - " bic %0, %0, %1\n" - " mcr p15, 0, %0, c1, c0, 1\n" - : "=&r" (v) - : "Ir" (0x40) - : "cc"); - - isb(); - dsb(); -} - static inline void cpu_leave_lowpower(void) { unsigned int v; @@ -141,10 +91,8 @@ void __ref exynos_cpu_die(unsigned int cpu) * appropriate sequence for entering low power. */ asm("mrc p15, 0, %0, c0, c0, 0" : "=r"(primary_part) : : "cc"); - if ((primary_part & 0xfff0) == 0xc0f0) - cpu_enter_lowpower_a15(); - else - cpu_enter_lowpower_a9(); + + v7_exit_coherency_flush(louis); platform_do_lowpower(cpu, &spurious);