samsung: cpuhp: Add panic condition when requesting hotplug cpu0 out
authorYoungtae Lee <yt0729.lee@samsung.com>
Wed, 2 May 2018 05:15:02 +0000 (14:15 +0900)
committerlakkyung.jung <lakkyung.jung@samsung.com>
Mon, 23 Jul 2018 05:59:12 +0000 (14:59 +0900)
Change-Id: I24152b1f32b82c6d413f8a0158f508f08b696679
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
drivers/soc/samsung/exynos-cpuhp.c

index 312c81f6b651d3b9b86863692bc61bc2525c6e07..3233f623b94a189f22ab5fa23b1003ec520872c6 100644 (file)
@@ -236,14 +236,17 @@ static struct cpumask cpuhp_get_online_cpus(void)
 {
        struct cpumask mask;
        struct cpuhp_user *user;
+       char buf[10];
 
        cpumask_setall(&mask);
 
        list_for_each_entry(user, &cpuhp.users, list)
                cpumask_and(&mask, &mask, &user->online_cpus);
 
-       if (cpumask_empty(&mask))
-               BUG_ON(1);
+       if (cpumask_empty(&mask) || !cpumask_test_cpu(0, &mask)) {
+               scnprintf(buf, sizeof(buf), "%*pbl", cpumask_pr_args(&mask));
+               panic("CPUHP: Online mask(%s) is wrong \n", buf);
+       }
 
        return mask;
 }
@@ -427,7 +430,7 @@ static ssize_t store_##name##_online_cpu(struct kobject *kobj,                      \
        size_t count)                                                           \
 {                                                                              \
        cpumask_parse(buf, &cpuhp.sysfs_user.online_cpus);                              \
-       cpuhp_do(cpuhp.sysfs_user.type);                                        \
+       cpuhp_do(true);                                 \
                                                                                \
        return count;                                                           \
 }                                                                              \