From patchwork Fri Apr 11 10:40:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 28272 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f199.google.com (mail-ig0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 612C620822 for ; Fri, 11 Apr 2014 10:40:52 +0000 (UTC) Received: by mail-ig0-f199.google.com with SMTP id c1sf2243560igq.10 for ; Fri, 11 Apr 2014 03:40:51 -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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=WehTbd5Gwjn7Bcegb1ygtaseDEBf/9fnA0VCzYBJKCY=; b=FkmcZLV2PuznPxUomNjO9YEwO3PCSxmUkMtcm6vuPEcScZg+rFTgA44cbduV0hNJye WiaPj1f5Gd/gB9DHicpt5BpQ/e2xtCFZH8HHIyrsLkZUi6wzg09sZKX2PPjR88/uqAco XsWeqrI6UYC2dbh5lpUzR8ORRaL7UTP3YMyr8LBN+herIvQWU3cDJ5eGRIBRod67v4Va OTCLTlswpHKfNG3j64lhuLz9Ce4yUcsD4jEaiT4KAGN4LuqHRFi9PXRWemGlRzEIP+Zo pkqqi3CuddRT9ESHqRCxq/49AiznhoFmIc+wI+LfyhBq9O1pNbPxQjqYiwPeN6HbtJ+B 0zlQ== X-Gm-Message-State: ALoCoQneuoAlAvFy+cwbiYdIV8j4Cf3dA6rBwFoZhWXPTM52U3AEdRnhQpA8vMstZz1ZHfyMX4J1 X-Received: by 10.182.241.97 with SMTP id wh1mr11165912obc.36.1397212851793; Fri, 11 Apr 2014 03:40:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.22 with SMTP id 22ls1496548qgi.63.gmail; Fri, 11 Apr 2014 03:40:51 -0700 (PDT) X-Received: by 10.52.165.105 with SMTP id yx9mr16200984vdb.22.1397212851622; Fri, 11 Apr 2014 03:40:51 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id ej2si1224722veb.203.2014.04.11.03.40.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 03:40:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id oz11so4500561veb.19 for ; Fri, 11 Apr 2014 03:40:51 -0700 (PDT) X-Received: by 10.221.58.144 with SMTP id wk16mr6335662vcb.23.1397212851400; Fri, 11 Apr 2014 03:40:51 -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 ib8csp46157vcb; Fri, 11 Apr 2014 03:40:51 -0700 (PDT) X-Received: by 10.69.1.69 with SMTP id be5mr26588677pbd.126.1397212850506; Fri, 11 Apr 2014 03:40:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iw3si3967193pac.14.2014.04.11.03.40.49; Fri, 11 Apr 2014 03:40:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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 S1754238AbaDKKkc (ORCPT + 8 others); Fri, 11 Apr 2014 06:40:32 -0400 Received: from mail-we0-f179.google.com ([74.125.82.179]:56637 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934703AbaDKKkF (ORCPT ); Fri, 11 Apr 2014 06:40:05 -0400 Received: by mail-we0-f179.google.com with SMTP id x48so5153919wes.38 for ; Fri, 11 Apr 2014 03:40:04 -0700 (PDT) X-Received: by 10.194.92.228 with SMTP id cp4mr1079868wjb.81.1397212804624; Fri, 11 Apr 2014 03:40:04 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-377-242.w86-199.abo.wanadoo.fr. [86.199.232.242]) by mx.google.com with ESMTPSA id eq8sm3683033wib.16.2014.04.11.03.40.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 03:40:03 -0700 (PDT) From: Daniel Lezcano To: kgene.kim@samsung.com Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, t.figa@samsung.com, linaro-kernel@lists.linaro.org, rjw@rjwysocki.net Subject: [PATCH V5 06/20] ARM: exynos: cpuidle: Move some code inside the idle_finisher Date: Fri, 11 Apr 2014 12:40:01 +0200 Message-Id: <1397212815-16068-7-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397212815-16068-1-git-send-email-daniel.lezcano@linaro.org> References: <1397212815-16068-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 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: , Move the code around to differentiate different section of code and prepare it to be factored out in the next patches. The call order changed but hat doesn't have a side effect because they are independent. The important call is cpu_do_idle() which must be done the last. Signed-off-by: Daniel Lezcano Reviewed-by: Viresh Kumar Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Tomasz Figa --- arch/arm/mach-exynos/cpuidle.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index f565186..4d8bcfd 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -68,7 +68,16 @@ static void restore_cpu_arch_register(void) static int idle_finisher(unsigned long flags) { + exynos_set_wakeupmask(); + + __raw_writel(virt_to_phys(s3c_cpu_resume), REG_DIRECTGO_ADDR); + __raw_writel(S5P_CHECK_AFTR, REG_DIRECTGO_FLAG); + + /* Set value of power down register for aftr mode */ + exynos_sys_powerdown_conf(SYS_AFTR); + cpu_do_idle(); + return 1; } @@ -78,14 +87,6 @@ static int exynos_enter_core0_aftr(struct cpuidle_device *dev, { unsigned long tmp; - exynos_set_wakeupmask(); - - /* Set value of power down register for aftr mode */ - exynos_sys_powerdown_conf(SYS_AFTR); - - __raw_writel(virt_to_phys(exynos_cpu_resume), REG_DIRECTGO_ADDR); - __raw_writel(S5P_CHECK_AFTR, REG_DIRECTGO_FLAG); - save_cpu_arch_register(); /* Setting Central Sequence Register for power down mode */