From patchwork Thu Jul 18 12:54:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 18416 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 82FE120F44 for ; Thu, 18 Jul 2013 12:54:36 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id u12sf4041905qcx.4 for ; Thu, 18 Jul 2013 05:54:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=yHdqKIzCY4wCqKqS+VOPoKaXFdYnSNB3rbpoahhzZbo=; b=Fon5rUU9LA0Q0YYG3CyTp0f+AGx75HF1MLsMF8TCNIKzJaPpiSNN8jKWrOtMUdB3Fw 29spKBWtEk0iAIbSIpxKCNuXm47BF1CS1jsBqGFuqUu6WdQL19h8r/Y9UHQEt9U26Op0 VJ4BWvZo3p5Xs/h0Qpk3xKLsDea1XPFn0ap05PyTbJuql0OMsEZM0d/EFVKHMVa0wNcz tmbw9OzF97yVWh8Lb7OesGhkkgNlaMNU5gfQVXIwUvob9QgVpE9ZkiNDHVl1xnt5C/lp hAOx7yRV3v6tBZOFWVvuH8d/8wI+LVYVN1CY2OpLJ3pRyHmY3GvuhE1PC9syhXtTtKqs WVhw== X-Received: by 10.236.91.4 with SMTP id g4mr6331127yhf.30.1374152075611; Thu, 18 Jul 2013 05:54:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.17.98 with SMTP id n2ls1323139qed.22.gmail; Thu, 18 Jul 2013 05:54:35 -0700 (PDT) X-Received: by 10.58.46.48 with SMTP id s16mr4003847vem.52.1374152075406; Thu, 18 Jul 2013 05:54:35 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id bk8si2748693vec.56.2013.07.18.05.54.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Jul 2013 05:54:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id m17so635914vca.3 for ; Thu, 18 Jul 2013 05:54:35 -0700 (PDT) X-Received: by 10.52.69.177 with SMTP id f17mr3415762vdu.48.1374152075306; Thu, 18 Jul 2013 05:54:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.149.77 with SMTP id s13csp223390vcv; Thu, 18 Jul 2013 05:54:34 -0700 (PDT) X-Received: by 10.194.123.199 with SMTP id mc7mr8397852wjb.35.1374152074254; Thu, 18 Jul 2013 05:54:34 -0700 (PDT) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by mx.google.com with ESMTPS id bm3si4447341wjb.12.2013.07.18.05.54.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Jul 2013 05:54:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.177 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=209.85.212.177; Received: by mail-wi0-f177.google.com with SMTP id ey16so3138935wid.10 for ; Thu, 18 Jul 2013 05:54:33 -0700 (PDT) X-Received: by 10.194.240.169 with SMTP id wb9mr8199809wjc.90.1374152073712; Thu, 18 Jul 2013 05:54:33 -0700 (PDT) Received: from mai.home (AToulouse-654-1-413-126.w82-125.abo.wanadoo.fr. [82.125.160.126]) by mx.google.com with ESMTPSA id r8sm16369267wiy.8.2013.07.18.05.54.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Jul 2013 05:54:32 -0700 (PDT) From: Daniel Lezcano To: kgene.kim@samsung.com, rjw@sisk.pl Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org Subject: [PATCH 1/4] ARM: exynos: cpuidle: Fallback to WFI, when AFTR is selected Date: Thu, 18 Jul 2013 14:54:27 +0200 Message-Id: <1374152070-21008-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQl6xcHCfjKpTC/BRoL+9YQqc+qby68DzEDlL36iYa/x4SwCkQHeJKG7A3qvSou0SyDNhY5N X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , When there are several cpus online, the AFTR state does not work. The AFTR must be selected only when there is one cpu online. The previous code was already handling this case. Simplified the code, especially the init routine to have the same init pattern than the other drivers. Signed-off-by: Daniel Lezcano --- arch/arm/mach-exynos/cpuidle.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 17a18ff..cc4b097 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -147,16 +147,11 @@ static int exynos4_enter_lowpower(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { - int new_index = index; - /* This mode only can be entered when other core's are offline */ if (num_online_cpus() > 1) - new_index = drv->safe_state_index; + return drv->states[0].enter(dev, drv, 0); - if (new_index == 0) - return arm_cpuidle_simple_enter(dev, drv, new_index); - else - return exynos4_enter_core0_aftr(dev, drv, new_index); + return exynos4_enter_core0_aftr(dev, drv, index); } static void __init exynos5_core_down_clk(void) @@ -209,10 +204,6 @@ static int __init exynos4_init_cpuidle(void) device = &per_cpu(exynos4_cpuidle_device, cpu_id); device->cpu = cpu_id; - /* Support IDLE only */ - if (cpu_id != 0) - device->state_count = 1; - ret = cpuidle_register_device(device); if (ret) { printk(KERN_ERR "CPUidle register device failed\n");