|
@@ -1047,23 +1047,18 @@ static struct attribute_group cpu_online_attr_group = {
|
|
.attrs = cpu_online_attrs,
|
|
.attrs = cpu_online_attrs,
|
|
};
|
|
};
|
|
|
|
|
|
-static int smp_cpu_notify(struct notifier_block *self, unsigned long action,
|
|
|
|
- void *hcpu)
|
|
|
|
|
|
+static int smp_cpu_online(unsigned int cpu)
|
|
{
|
|
{
|
|
- unsigned int cpu = (unsigned int)(long)hcpu;
|
|
|
|
struct device *s = &per_cpu(cpu_device, cpu)->dev;
|
|
struct device *s = &per_cpu(cpu_device, cpu)->dev;
|
|
- int err = 0;
|
|
|
|
|
|
|
|
- switch (action & ~CPU_TASKS_FROZEN) {
|
|
|
|
- case CPU_ONLINE:
|
|
|
|
- case CPU_DOWN_FAILED:
|
|
|
|
- err = sysfs_create_group(&s->kobj, &cpu_online_attr_group);
|
|
|
|
- break;
|
|
|
|
- case CPU_DOWN_PREPARE:
|
|
|
|
- sysfs_remove_group(&s->kobj, &cpu_online_attr_group);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- return notifier_from_errno(err);
|
|
|
|
|
|
+ return sysfs_create_group(&s->kobj, &cpu_online_attr_group);
|
|
|
|
+}
|
|
|
|
+static int smp_cpu_pre_down(unsigned int cpu)
|
|
|
|
+{
|
|
|
|
+ struct device *s = &per_cpu(cpu_device, cpu)->dev;
|
|
|
|
+
|
|
|
|
+ sysfs_remove_group(&s->kobj, &cpu_online_attr_group);
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
static int smp_add_present_cpu(int cpu)
|
|
static int smp_add_present_cpu(int cpu)
|
|
@@ -1084,20 +1079,12 @@ static int smp_add_present_cpu(int cpu)
|
|
rc = sysfs_create_group(&s->kobj, &cpu_common_attr_group);
|
|
rc = sysfs_create_group(&s->kobj, &cpu_common_attr_group);
|
|
if (rc)
|
|
if (rc)
|
|
goto out_cpu;
|
|
goto out_cpu;
|
|
- if (cpu_online(cpu)) {
|
|
|
|
- rc = sysfs_create_group(&s->kobj, &cpu_online_attr_group);
|
|
|
|
- if (rc)
|
|
|
|
- goto out_online;
|
|
|
|
- }
|
|
|
|
rc = topology_cpu_init(c);
|
|
rc = topology_cpu_init(c);
|
|
if (rc)
|
|
if (rc)
|
|
goto out_topology;
|
|
goto out_topology;
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
out_topology:
|
|
out_topology:
|
|
- if (cpu_online(cpu))
|
|
|
|
- sysfs_remove_group(&s->kobj, &cpu_online_attr_group);
|
|
|
|
-out_online:
|
|
|
|
sysfs_remove_group(&s->kobj, &cpu_common_attr_group);
|
|
sysfs_remove_group(&s->kobj, &cpu_common_attr_group);
|
|
out_cpu:
|
|
out_cpu:
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
@@ -1150,17 +1137,15 @@ static int __init s390_smp_init(void)
|
|
if (rc)
|
|
if (rc)
|
|
return rc;
|
|
return rc;
|
|
#endif
|
|
#endif
|
|
- cpu_notifier_register_begin();
|
|
|
|
for_each_present_cpu(cpu) {
|
|
for_each_present_cpu(cpu) {
|
|
rc = smp_add_present_cpu(cpu);
|
|
rc = smp_add_present_cpu(cpu);
|
|
if (rc)
|
|
if (rc)
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
- __hotcpu_notifier(smp_cpu_notify, 0);
|
|
|
|
-
|
|
|
|
|
|
+ rc = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "s390/smp:online",
|
|
|
|
+ smp_cpu_online, smp_cpu_pre_down);
|
|
out:
|
|
out:
|
|
- cpu_notifier_register_done();
|
|
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
subsys_initcall(s390_smp_init);
|
|
subsys_initcall(s390_smp_init);
|