From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Kukjin Kim <kgene.kim@samsung.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Tomasz Figa <t.figa@samsung.com>,
Amit Daniel Kachhap <amit.daniel@samsung.com>,
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 [thread overview]
Message-ID: <4002844.4ZqqJexTv4@amdc1032> (raw)
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 <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
---
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 <linux/export.h>
#include <linux/time.h>
#include <linux/platform_device.h>
+#include <linux/moduleparam.h>
#include <asm/proc-fns.h>
#include <asm/smp_scu.h>
@@ -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);
--
1.8.2.3
next reply other threads:[~2013-08-30 10:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-30 10:21 Bartlomiej Zolnierkiewicz [this message]
2013-09-02 8:54 ` [PATCH 2/2] ARM: EXYNOS: add cpuidle-exynos.max_states kernel parameter Daniel Lezcano
2013-09-02 9:41 ` Bartlomiej Zolnierkiewicz
2013-09-02 13:18 ` Daniel Lezcano
2013-09-02 13:48 ` Bartlomiej Zolnierkiewicz
2013-09-02 14:24 ` Daniel Lezcano
2013-09-02 14:43 ` Bartlomiej Zolnierkiewicz
2013-09-02 15:52 ` Daniel Lezcano
2013-09-02 16:13 ` Bartlomiej Zolnierkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4002844.4ZqqJexTv4@amdc1032 \
--to=b.zolnierkie@samsung.com \
--cc=amit.daniel@samsung.com \
--cc=daniel.lezcano@linaro.org \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=t.figa@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox