|
@@ -703,7 +703,7 @@ static struct device_attribute pa6t_attrs[] = {
|
|
#endif /* HAS_PPC_PMC_PA6T */
|
|
#endif /* HAS_PPC_PMC_PA6T */
|
|
#endif /* HAS_PPC_PMC_CLASSIC */
|
|
#endif /* HAS_PPC_PMC_CLASSIC */
|
|
|
|
|
|
-static void register_cpu_online(unsigned int cpu)
|
|
|
|
|
|
+static int register_cpu_online(unsigned int cpu)
|
|
{
|
|
{
|
|
struct cpu *c = &per_cpu(cpu_devices, cpu);
|
|
struct cpu *c = &per_cpu(cpu_devices, cpu);
|
|
struct device *s = &c->dev;
|
|
struct device *s = &c->dev;
|
|
@@ -782,11 +782,12 @@ static void register_cpu_online(unsigned int cpu)
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
cacheinfo_cpu_online(cpu);
|
|
cacheinfo_cpu_online(cpu);
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-#ifdef CONFIG_HOTPLUG_CPU
|
|
|
|
-static void unregister_cpu_online(unsigned int cpu)
|
|
|
|
|
|
+static int unregister_cpu_online(unsigned int cpu)
|
|
{
|
|
{
|
|
|
|
+#ifdef CONFIG_HOTPLUG_CPU
|
|
struct cpu *c = &per_cpu(cpu_devices, cpu);
|
|
struct cpu *c = &per_cpu(cpu_devices, cpu);
|
|
struct device *s = &c->dev;
|
|
struct device *s = &c->dev;
|
|
struct device_attribute *attrs, *pmc_attrs;
|
|
struct device_attribute *attrs, *pmc_attrs;
|
|
@@ -863,6 +864,8 @@ static void unregister_cpu_online(unsigned int cpu)
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
cacheinfo_cpu_offline(cpu);
|
|
cacheinfo_cpu_offline(cpu);
|
|
|
|
+#endif /* CONFIG_HOTPLUG_CPU */
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
|
|
#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
|
|
@@ -883,32 +886,6 @@ ssize_t arch_cpu_release(const char *buf, size_t count)
|
|
}
|
|
}
|
|
#endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */
|
|
#endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */
|
|
|
|
|
|
-#endif /* CONFIG_HOTPLUG_CPU */
|
|
|
|
-
|
|
|
|
-static int sysfs_cpu_notify(struct notifier_block *self,
|
|
|
|
- unsigned long action, void *hcpu)
|
|
|
|
-{
|
|
|
|
- unsigned int cpu = (unsigned int)(long)hcpu;
|
|
|
|
-
|
|
|
|
- switch (action) {
|
|
|
|
- case CPU_ONLINE:
|
|
|
|
- case CPU_ONLINE_FROZEN:
|
|
|
|
- register_cpu_online(cpu);
|
|
|
|
- break;
|
|
|
|
-#ifdef CONFIG_HOTPLUG_CPU
|
|
|
|
- case CPU_DEAD:
|
|
|
|
- case CPU_DEAD_FROZEN:
|
|
|
|
- unregister_cpu_online(cpu);
|
|
|
|
- break;
|
|
|
|
-#endif
|
|
|
|
- }
|
|
|
|
- return NOTIFY_OK;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static struct notifier_block sysfs_cpu_nb = {
|
|
|
|
- .notifier_call = sysfs_cpu_notify,
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
static DEFINE_MUTEX(cpu_mutex);
|
|
static DEFINE_MUTEX(cpu_mutex);
|
|
|
|
|
|
int cpu_add_dev_attr(struct device_attribute *attr)
|
|
int cpu_add_dev_attr(struct device_attribute *attr)
|
|
@@ -1023,12 +1000,10 @@ static DEVICE_ATTR(physical_id, 0444, show_physical_id, NULL);
|
|
|
|
|
|
static int __init topology_init(void)
|
|
static int __init topology_init(void)
|
|
{
|
|
{
|
|
- int cpu;
|
|
|
|
|
|
+ int cpu, r;
|
|
|
|
|
|
register_nodes();
|
|
register_nodes();
|
|
|
|
|
|
- cpu_notifier_register_begin();
|
|
|
|
-
|
|
|
|
for_each_possible_cpu(cpu) {
|
|
for_each_possible_cpu(cpu) {
|
|
struct cpu *c = &per_cpu(cpu_devices, cpu);
|
|
struct cpu *c = &per_cpu(cpu_devices, cpu);
|
|
|
|
|
|
@@ -1047,15 +1022,10 @@ static int __init topology_init(void)
|
|
|
|
|
|
device_create_file(&c->dev, &dev_attr_physical_id);
|
|
device_create_file(&c->dev, &dev_attr_physical_id);
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (cpu_online(cpu))
|
|
|
|
- register_cpu_online(cpu);
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- __register_cpu_notifier(&sysfs_cpu_nb);
|
|
|
|
-
|
|
|
|
- cpu_notifier_register_done();
|
|
|
|
-
|
|
|
|
|
|
+ r = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "powerpc/topology:online",
|
|
|
|
+ register_cpu_online, unregister_cpu_online);
|
|
|
|
+ WARN_ON(r < 0);
|
|
#ifdef CONFIG_PPC64
|
|
#ifdef CONFIG_PPC64
|
|
sysfs_create_dscr_default();
|
|
sysfs_create_dscr_default();
|
|
#endif /* CONFIG_PPC64 */
|
|
#endif /* CONFIG_PPC64 */
|