From patchwork Fri Aug 30 10:21:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 2851867 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0F5D89F313 for ; Fri, 30 Aug 2013 10:21:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7D012039A for ; Fri, 30 Aug 2013 10:21:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62CFF20315 for ; Fri, 30 Aug 2013 10:21:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754655Ab3H3KVV (ORCPT ); Fri, 30 Aug 2013 06:21:21 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:19858 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752882Ab3H3KVV (ORCPT ); Fri, 30 Aug 2013 06:21:21 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MSC0025PA3JN5G0@mailout3.samsung.com>; Fri, 30 Aug 2013 19:21:19 +0900 (KST) X-AuditID: cbfee61a-b7f7a6d00000235f-5d-5220721f9288 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 99.D5.09055.F1270225; Fri, 30 Aug 2013 19:21:19 +0900 (KST) Received: from amdc1032.localnet ([106.116.147.136]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MSC008N9A3CPQD0@mmp1.samsung.com>; Fri, 30 Aug 2013 19:21:18 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Kukjin Kim Cc: Daniel Lezcano , "Rafael J. Wysocki" , Tomasz Figa , Amit Daniel Kachhap , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 2/2] ARM: EXYNOS: add cpuidle-exynos.max_states kernel parameter Date: Fri, 30 Aug 2013 12:21:07 +0200 Message-id: <4002844.4ZqqJexTv4@amdc1032> User-Agent: KMail/4.8.4 (Linux/3.2.0-52-generic-pae; KDE/4.8.5; i686; ; ) MIME-version: 1.0 Content-transfer-encoding: 7Bit Content-type: text/plain; charset=us-ascii X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGLMWRmVeSWpSXmKPExsVy+t9jAV35IoUgg4u32C0aroZYzPssa9G7 4CqbxabH11gtPvceYbSYcX4fk0X/wl4mi/UzXrM4cHjcubaHzWPzknqPvi2rGD0eLW5h9Pi8 SS6ANYrLJiU1J7MstUjfLoErY3uTW8EHoYpZu0+xNDA+5u9i5OSQEDCRuLFiFiuELSZx4d56 ti5GLg4hgUWMEgte74dyWpgkDh2/CFbFJmAlMbF9FSOILSKgJtGzeCsjSBGzQC+TxPrWxUwg CWGBAIkJ04+A2SwCqhLbD9wDs3kFNCXW33zJBmKLCnhKfJq0lBkiLijxY/I9FhCbWUBeYt/+ qawQtpbE+p3HmSYw8s1CUjYLSdksJGULGJlXMYqmFiQXFCel5xrqFSfmFpfmpesl5+duYgSH 7jOpHYwrGywOMQpwMCrx8D4Ilg8SYk0sK67MPcQowcGsJMJbkaoQJMSbklhZlVqUH19UmpNa fIhRmoNFSZz3QKt1oJBAemJJanZqakFqEUyWiYNTqoFx89t7RmF3fj+v+vOH+e7m5l3zWN4e 7S9RvWu5bM6+2DmbX7xbpBw/adEJU0nN/UvfXfzevvRGbt3bq1f4vve/MS75L3Z5ToVPXMCC lIQjy+69zHJNLjlqxdiQcyUme9mM1UfsQt6+q1d9vTw/o8E4z/xKs8Z0l0+e90M+CW4O3b3m xdboBsm7SUosxRmJhlrMRcWJAFtq56tZAgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add "cpuidle-exynos.max_states=" parameter to allow user to specify the maximum of allowed CPU idle states for ARM EXYNOS cpuidle driver. This change is needed because C1 state (AFTR mode) is often not able to work properly due to incompatibility with some bootloader versions. Usage examples: "cpuidle-exynos.max_states=1" disables C1 state (AFTR mode). "cpuidle-exynos.max_states=0" disables the driver completely. Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Kyungmin Park Cc: Tomasz Figa Cc: Amit Daniel Kachhap --- arch/arm/mach-exynos/cpuidle.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 8e881e0..ead0f71 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -30,6 +31,9 @@ #include "common.h" +#define MODULE_PARAM_PREFIX "cpuidle-exynos." +#define PREFIX "cpuidle-exynos: " + #define REG_DIRECTGO_ADDR (samsung_rev() == EXYNOS4210_REV_1_1 ? \ S5P_INFORM7 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \ (S5P_VA_SYSRAM + 0x24) : S5P_INFORM0)) @@ -63,6 +67,9 @@ static struct cpuidle_driver exynos4_idle_driver = { .safe_state_index = 0, }; +/* cpuidle-exynos.max_states=0 disables driver */ +static int max_states = CPUIDLE_STATE_MAX; + /* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */ static void exynos4_set_wakeupmask(void) { @@ -198,6 +205,16 @@ static int __init exynos_cpuidle_probe(struct platform_device *pdev) int cpu_id, ret; struct cpuidle_device *device; + if (max_states == 0) { + pr_info(PREFIX "disabled\n"); + return 0; + } + + if (max_states < exynos4_idle_driver.state_count) { + pr_info(PREFIX "limiting to %d state(s)\n", max_states); + exynos4_idle_driver.state_count = max_states; + } + if (soc_is_exynos5250()) exynos5_core_down_clk(); @@ -234,3 +251,5 @@ static struct platform_driver exynos_cpuidle_driver = { }; module_platform_driver(exynos_cpuidle_driver); + +module_param(max_states, int, 0444);