pass-hal: tm2: Prevent attempt to turn off CPU0 84/121684/2 accepted/tizen_mobile accepted/tizen/mobile/20170331.082859 accepted/tizen/unified/20170331.083037 submit/tizen/20170330.074020
authorChanwoo Choi <cw00.choi@samsung.com>
Tue, 28 Mar 2017 11:17:49 +0000 (20:17 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 29 Mar 2017 07:16:55 +0000 (16:16 +0900)
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 <cw00.choi@samsung.com>
src/cpu/cpu.c

index 83bdde0..c837688 100644 (file)
@@ -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,