aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/cpuidle.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2013-12-20 13:47:23 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-10 19:26:48 -0500
commit118f5c1d5518032eec773164779f17d6e9b31586 (patch)
treeab28f6c671a547743186cda03e38148a63d8938a /arch/arm/mach-exynos/cpuidle.c
parent88390996c95b879ba365888199b45ace3f5ca80b (diff)
ARM: EXYNOS: cpuidle: fix AFTR mode check
The EXYNOS cpuidle driver code assumes that cpuidle core will handle dev->state_count smaller than drv->state_count but currently this is untrue (dev->state_count is used only for handling cpuidle state sysfs entries and drv->state_count is used for all other cases) and will not be fixed in the future as dev->state_count is planned to be removed. Fix the issue by checking for the max supported idle state in AFTR state's ->enter handler (exynos4_enter_lowpower()) and entering AFTR mode only when cores other than CPU0 are offline. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/arm/mach-exynos/cpuidle.c')
-rw-r--r--arch/arm/mach-exynos/cpuidle.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index ddbfe8709fe7..8e0eb2ef8c41 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -151,8 +151,8 @@ static int exynos4_enter_lowpower(struct cpuidle_device *dev,
151{ 151{
152 int new_index = index; 152 int new_index = index;
153 153
154 /* This mode only can be entered when other core's are offline */ 154 /* AFTR can only be entered when cores other than CPU0 are offline */
155 if (num_online_cpus() > 1) 155 if (num_online_cpus() > 1 || dev->cpu != 0)
156 new_index = drv->safe_state_index; 156 new_index = drv->safe_state_index;
157 157
158 if (new_index == 0) 158 if (new_index == 0)
@@ -214,10 +214,6 @@ static int exynos_cpuidle_probe(struct platform_device *pdev)
214 device = &per_cpu(exynos4_cpuidle_device, cpu_id); 214 device = &per_cpu(exynos4_cpuidle_device, cpu_id);
215 device->cpu = cpu_id; 215 device->cpu = cpu_id;
216 216
217 /* Support IDLE only */
218 if (cpu_id != 0)
219 device->state_count = 1;
220
221 ret = cpuidle_register_device(device); 217 ret = cpuidle_register_device(device);
222 if (ret) { 218 if (ret) {
223 dev_err(&pdev->dev, "failed to register cpuidle device\n"); 219 dev_err(&pdev->dev, "failed to register cpuidle device\n");