From 1e2823dc0bf7309efe73207b7295a00e703c2fda Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Tue, 28 Mar 2017 20:17:49 +0900 Subject: [PATCH] pass-hal: tm2: Prevent attempt to turn off CPU0 This patch prevents the attempt to turn off CPU0 because TM2 uses the Exynos5433 SoC which doesn't permit to turn off the CPU0 due to the h/w design issue. Change-Id: I6795aad5ff80c1728db42bc808bac8806d5daa76 Signed-off-by: Chanwoo Choi --- src/cpu/cpu.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 83bdde0..c837688 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -271,7 +271,6 @@ static int tm2_hotplug_set_online_state(char *res_name, int cpu, int on) char path[PATH_MAX]; int ret; - if ((!res_name)) return -EINVAL; if ((cpu < TM2_CPU_MIN_NUM) || (cpu > TM2_CPU_MAX_NUM)) @@ -279,7 +278,16 @@ static int tm2_hotplug_set_online_state(char *res_name, int cpu, int on) if ((on != CPU_ONLINE_STATE_ON) && (on != CPU_ONLINE_STATE_OFF)) return -EINVAL; - /* TODO: Can we turn off CPU0? */ + /* + * NOTE: Exynos SoC series cannot turn off the CPU0 + * because of h/w design. To prevent the critical problem, + * if someone try to turn off the CPU0, just return without any + * opertaion. + */ + if (on == 0 && cpu == 0) { + _E("cannot turn off the CPU0"); + return 0; + } snprintf(path, PATH_MAX, "%s%d%s", CPU_ONLINE_PATH_PREFIX, -- 2.7.4