Commit a522b7ad authored by Tiezhu Yang's avatar Tiezhu Yang Committed by Huacai Chen

LoongArch: Do not create sysfs control file for io master CPUs

Now io master CPUs are not hotpluggable on LoongArch, but in the current
code only /sys/devices/system/cpu/cpu0/online is not created. Let us set
the hotpluggable field of all the io master CPUs as 0, then prevent to
create sysfs control file for all the io master CPUs which confuses some
user space tools. This is similar with commit 9cce844a ("MIPS: CPU#0
is not hotpluggable").
Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent 4b2edd38
...@@ -40,4 +40,9 @@ extern unsigned long fw_arg0, fw_arg1, fw_arg2; ...@@ -40,4 +40,9 @@ extern unsigned long fw_arg0, fw_arg1, fw_arg2;
extern struct loongson_board_info b_info; extern struct loongson_board_info b_info;
extern struct loongson_system_configuration loongson_sysconf; extern struct loongson_system_configuration loongson_sysconf;
static inline bool io_master(int cpu)
{
return test_bit(cpu, &loongson_sysconf.cores_io_master);
}
#endif /* _ASM_BOOTINFO_H */ #endif /* _ASM_BOOTINFO_H */
...@@ -240,11 +240,6 @@ void loongson3_smp_finish(void) ...@@ -240,11 +240,6 @@ void loongson3_smp_finish(void)
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
static bool io_master(int cpu)
{
return test_bit(cpu, &loongson_sysconf.cores_io_master);
}
int loongson3_cpu_disable(void) int loongson3_cpu_disable(void)
{ {
unsigned long flags; unsigned long flags;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/node.h> #include <linux/node.h>
#include <linux/nodemask.h> #include <linux/nodemask.h>
#include <linux/percpu.h> #include <linux/percpu.h>
#include <asm/bootinfo.h>
static DEFINE_PER_CPU(struct cpu, cpu_devices); static DEFINE_PER_CPU(struct cpu, cpu_devices);
...@@ -40,7 +41,7 @@ static int __init topology_init(void) ...@@ -40,7 +41,7 @@ static int __init topology_init(void)
for_each_present_cpu(i) { for_each_present_cpu(i) {
struct cpu *c = &per_cpu(cpu_devices, i); struct cpu *c = &per_cpu(cpu_devices, i);
c->hotpluggable = !!i; c->hotpluggable = !io_master(i);
ret = register_cpu(c, i); ret = register_cpu(c, i);
if (ret < 0) if (ret < 0)
pr_warn("topology_init: register_cpu %d failed (%d)\n", i, ret); pr_warn("topology_init: register_cpu %d failed (%d)\n", i, ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment