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: 2851869 Return-Path: X-Original-To: patchwork-linux-arm@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 0578E9F313 for ; Fri, 30 Aug 2013 10:21:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F056720394 for ; Fri, 30 Aug 2013 10:21:57 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A416120315 for ; Fri, 30 Aug 2013 10:21:56 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VFLpu-0002pO-9d; Fri, 30 Aug 2013 10:21:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VFLps-0001wM-4I; Fri, 30 Aug 2013 10:21:48 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VFLpm-0001v7-BP for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2013 10:21:45 +0000 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> for linux-arm-kernel@lists.infradead.org; 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 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130830_062142_634074_648B2242 X-CRM114-Status: GOOD ( 13.73 ) X-Spam-Score: -9.0 (---------) Cc: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, Tomasz Figa , Daniel Lezcano , "Rafael J. Wysocki" , Amit Daniel Kachhap , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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);