* [PATCH] MIPS: No need to check CPU 0 in cps_cpu_disable()
@ 2020-12-15 5:07 Tiezhu Yang
2020-12-28 21:40 ` Thomas Bogendoerfer
0 siblings, 1 reply; 2+ messages in thread
From: Tiezhu Yang @ 2020-12-15 5:07 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel, Wei Li, Xuefeng Li
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) <liwei391@huawei.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
cps_cpu_disable() is not done in the early similar patch,
sorry for that.
arch/mips/kernel/smp-cps.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index 8b027c7..bcd6a94 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;
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: No need to check CPU 0 in cps_cpu_disable()
2020-12-15 5:07 [PATCH] MIPS: No need to check CPU 0 in cps_cpu_disable() Tiezhu Yang
@ 2020-12-28 21:40 ` Thomas Bogendoerfer
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2020-12-28 21:40 UTC (permalink / raw)
To: Tiezhu Yang; +Cc: linux-mips, linux-kernel, Wei Li, Xuefeng Li
On Tue, Dec 15, 2020 at 01:07:26PM +0800, Tiezhu Yang wrote:
> 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) <liwei391@huawei.com>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>
> cps_cpu_disable() is not done in the early similar patch,
> sorry for that.
>
> arch/mips/kernel/smp-cps.c | 3 ---
> 1 file changed, 3 deletions(-)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-28 22:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 5:07 [PATCH] MIPS: No need to check CPU 0 in cps_cpu_disable() Tiezhu Yang
2020-12-28 21:40 ` Thomas Bogendoerfer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.