From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758005AbaD3ICy (ORCPT ); Wed, 30 Apr 2014 04:02:54 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:53956 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757781AbaD3ICO (ORCPT ); Wed, 30 Apr 2014 04:02:14 -0400 X-AuditID: cbfee690-b7fcd6d0000026e0-82-5360ae052bc9 Message-id: <5360AE05.7020106@samsung.com> Date: Wed, 30 Apr 2014 17:02:13 +0900 From: Chanwoo Choi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-version: 1.0 To: Leela Krishna Amudala Cc: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, daniel.lezcano@linaro.org, nicolas.pitre@linaro.org, kgene.kim@samsung.com, amit.kucheria@linaro.org Subject: Re: [PATCH V2] ARM: EXYNOS: cpu hotplug: use v7_exit_coherency_flush macro for cache disabling References: <1398232351-16280-1-git-send-email-leela.krishna@linaro.org> In-reply-to: <1398232351-16280-1-git-send-email-leela.krishna@linaro.org> Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsWyRsSkRJd1XUKwwbl/IhbNDYuZLOZ9lrXo XXCVzWLC/g8sFpseX2O1uLxrDpvF594jjBYzzu9jsvj07B+7A6fHnWt72Dw2L6n36NuyitHj 8ya5AJYoLpuU1JzMstQifbsEroyF/26zFHRIVHQd+MfawLhWqIuRk0NCwESi5fxiVghbTOLC vfVsXYxcHEICSxklrrY1ssEUNb25xwyRmM4osWbbEkYI5zWjxPRXr8CqeAW0JH4dOckCYrMI qErceD2LCcRmA4rvf3EDrEZUIExi5fQrLBD1ghI/Jt8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LzczcxgqP7mfQOxlUNFocY BTgYlXh4BbbGBwuxJpYVV+YeYpTgYFYS4c3oSAgW4k1JrKxKLcqPLyrNSS0+xJgMDIGJzFKi yfnAxJNXEm9obGJmZGlkbmhhZGxOmrCSOO/BVutAIYH0xJLU7NTUgtQimC1MHJxSDYyre+Rm OSfeDzT6cz7pQ0LjtpUVwa7/PkUtW6HiE6fqxLpl+vf3agoP13arpL/nXH7owI+ubnP+lzlq 8640ynK4zGv6NluNvWD5A875Yp4H9izaqtj7/sr6BTM9nzzwN/BqmKzh4a3UclNz52ehJO73 126c2m4dofGXq1JwNVedT3b0nUbRHmYlluKMREMt5qLiRAC2UmuCMgMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 04/23/2014 02:52 PM, Leela Krishna Amudala wrote: > A common macro v7_exit_coherency_flush available which does the below tasks in > the seqeunce. > -clearing C bit > -clearing L1 cache > -exit SMP > -instruction and data synchronization > > So removing the local functions which does the same thing and use the macro instead. > > Signed-off-by: Leela Krishna Amudala > Acked-by: Nicolas Pitre > --- > Changes since V1: > - removed unwanted primary_part variable in exynos_cpu_die() > - given more description in commit message > suggested by Daniel Lezcano > > arch/arm/mach-exynos/hotplug.c | 63 +--------------------------------------- > 1 file changed, 1 insertion(+), 62 deletions(-) > > diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c > index 5eead53..9ca692d 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; > @@ -132,19 +82,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious) > void __ref exynos_cpu_die(unsigned int cpu) > { > int spurious = 0; > - int primary_part = 0; > > - /* > - * we're ready for shutdown now, so do it. > - * Exynos4 is A9 based while Exynos5 is A15; check the CPU part > - * number by reading the Main ID register and then perform the > - * 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); > > I tested this patch on Exynos3250 based on Cortex-A7 dual core. Tested-by: Chanwoo Choi Thanks, Chanwoo Choi