From: Tiezhu Yang Date: Tue, 15 Dec 2020 05:07:26 +0000 (+0800) Subject: MIPS: No need to check CPU 0 in cps_cpu_disable() X-Git-Tag: v5.12-rc1~31^2~108 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=dbafd5105cfd9f44960bc6759a788f0290e8fba0;p=tomoyo%2Ftomoyo-test1.git MIPS: No need to check CPU 0 in cps_cpu_disable() After commit 9cce844abf07 ("MIPS: CPU#0 is not hotpluggable"), c->hotpluggable is 0 for CPU 0 and it will not generate a control file in sysfs for this CPU: [root@linux loongson]# cat /sys/devices/system/cpu/cpu0/online cat: /sys/devices/system/cpu/cpu0/online: No such file or directory [root@linux loongson]# echo 0 > /sys/devices/system/cpu/cpu0/online bash: /sys/devices/system/cpu/cpu0/online: Permission denied So no need to check CPU 0 in cps_cpu_disable(), just remove it. Reported-by: liwei (GF) Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer --- diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index 8b027c72b8ef..bcd6a944b839 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -451,9 +451,6 @@ static int cps_cpu_disable(void) unsigned cpu = smp_processor_id(); struct core_boot_config *core_cfg; - if (!cpu) - return -EBUSY; - if (!cps_pm_support_state(CPS_PM_POWER_GATED)) return -EINVAL;