From patchwork Fri Jan 4 16:59:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 13807 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D1FE423EC8 for ; Fri, 4 Jan 2013 17:00:10 +0000 (UTC) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by fiordland.canonical.com (Postfix) with ESMTP id 84D7CA197E1 for ; Fri, 4 Jan 2013 17:00:10 +0000 (UTC) Received: by mail-vc0-f181.google.com with SMTP id gb30so16412047vcb.26 for ; Fri, 04 Jan 2013 09:00:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=YuFsGlb30ilZMO6izMCBAcsEZZ2XMngswIQe3AWjTIc=; b=L4c03oBcaqSKKDHwp681ZVISBTqzyitxrfL36My23KbLuHZ0oCUu0rKPhAsnc4svg8 zMQOTLFrZ4ZD4IvLdWOqAaYd3bNpHcIijc/0vaAp5xJI1HoyD2lyOxwj5WHxM9DrXBxl FDjlbZLajF1p6DJDFzLxTXGScUV+UFENqTvinlvCHzzCb7qU6h4aeb5Vq2i0feWKplmi 0N76COm/v2IDQX/VX7P47oA8g0+B8Gv7tOqThXzgEvCiq5syec2K4EWNRePB5v/FM1WP 1jX2vj+FoBbU/WpjiZrhB2z9W2Riyx+DlNAvTfM2DoG0/RgDba6zuF/Re/jFjaiQkha6 1lVA== X-Received: by 10.220.218.197 with SMTP id hr5mr75462951vcb.8.1357318810054; Fri, 04 Jan 2013 09:00:10 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp146427veb; Fri, 4 Jan 2013 09:00:09 -0800 (PST) X-Received: by 10.194.76.7 with SMTP id g7mr6047902wjw.50.1357318809151; Fri, 04 Jan 2013 09:00:09 -0800 (PST) Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by mx.google.com with ESMTPS id h1si77063584wie.33.2013.01.04.09.00.08 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 09:00:09 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.45 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.45 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-wg0-f45.google.com with SMTP id dq12so7536864wgb.0 for ; Fri, 04 Jan 2013 09:00:08 -0800 (PST) X-Received: by 10.194.89.167 with SMTP id bp7mr84313695wjb.0.1357318808765; Fri, 04 Jan 2013 09:00:08 -0800 (PST) Received: from mai.home (AToulouse-654-1-322-234.w86-199.abo.wanadoo.fr. [86.199.209.234]) by mx.google.com with ESMTPS id t17sm91133761wiv.6.2013.01.04.09.00.06 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 09:00:07 -0800 (PST) From: Daniel Lezcano To: kgene.kim@samsung.com Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, patches@linaro.org, linaro-dev@lists.linaro.org Subject: [PATCH 4/5] ARM: exynos: only register cpuidle for cpu0 Date: Fri, 4 Jan 2013 17:59:58 +0100 Message-Id: <1357318799-24378-4-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1357318799-24378-1-git-send-email-daniel.lezcano@linaro.org> References: <1357318799-24378-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQmvz0KmJ/6Xzc7X4xB4rw8+5yKSZWuNfaaVQPlKnsF1uUwSFWMeYotmKj9/W0rZWf4Rvjsi We register the device for cpu1 but with only one state which is actually WFI. This one is already the default idle function when no cpuidle device is set for the cpu. We can remove the cpuidle device for this cpu as it is the same code path than the pm_idle callback. Signed-off-by: Daniel Lezcano --- arch/arm/mach-exynos/cpuidle.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 6e90bed..e6f006b 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -40,7 +40,7 @@ static int exynos4_enter_lowpower(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index); -static DEFINE_PER_CPU(struct cpuidle_device, exynos4_cpuidle_device); +static struct cpuidle_device exynos4_cpuidle_device; static struct cpuidle_driver exynos4_idle_driver = { .name = "exynos4_idle", @@ -193,8 +193,7 @@ static void __init exynos5_core_down_clk(void) static int __init exynos4_init_cpuidle(void) { - int cpu_id, ret; - struct cpuidle_device *device; + int ret; if (soc_is_exynos5250()) exynos5_core_down_clk(); @@ -205,19 +204,10 @@ static int __init exynos4_init_cpuidle(void) return ret; } - for_each_online_cpu(cpu_id) { - 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"); - return ret; - } + ret = cpuidle_register_device(&exynos4_cpuidle_device); + if (ret) { + printk(KERN_ERR "CPUidle register device failed\n"); + return ret; } return 0;