Commit 72486f1f authored by Siddha, Suresh B's avatar Siddha, Suresh B Committed by Andi Kleen

[PATCH] i386: change the 'no_control' field to 'hotpluggable' in the struct cpu

Change the 'no_control' field in the cpu struct to a more positive
and better term 'hotpluggable'. And change(/cleanup) the logic accordingly.
Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Cc: "Li, Shaohua" <shaohua.li@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
parent fd6d7d26
...@@ -44,8 +44,8 @@ int arch_register_cpu(int num) ...@@ -44,8 +44,8 @@ int arch_register_cpu(int num)
* Also certain PCI quirks require not to enable hotplug control * Also certain PCI quirks require not to enable hotplug control
* for all CPU's. * for all CPU's.
*/ */
if (!num || !enable_cpu_hotplug) if (num && enable_cpu_hotplug)
cpu_devices[num].cpu.no_control = 1; cpu_devices[num].cpu.hotpluggable = 1;
return register_cpu(&cpu_devices[num].cpu, num); return register_cpu(&cpu_devices[num].cpu, num);
} }
......
...@@ -31,11 +31,11 @@ int arch_register_cpu(int num) ...@@ -31,11 +31,11 @@ int arch_register_cpu(int num)
{ {
#if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU) #if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU)
/* /*
* If CPEI cannot be re-targetted, and this is * If CPEI can be re-targetted or if this is not
* CPEI target, then dont create the control file * CPEI target, then it is hotpluggable
*/ */
if (!can_cpei_retarget() && is_cpu_cpei_target(num)) if (can_cpei_retarget() || !is_cpu_cpei_target(num))
sysfs_cpus[num].cpu.no_control = 1; sysfs_cpus[num].cpu.hotpluggable = 1;
map_cpu_to_node(num, node_cpuid[num].nid); map_cpu_to_node(num, node_cpuid[num].nid);
#endif #endif
......
...@@ -239,7 +239,7 @@ static void unregister_cpu_online(unsigned int cpu) ...@@ -239,7 +239,7 @@ static void unregister_cpu_online(unsigned int cpu)
struct cpu *c = &per_cpu(cpu_devices, cpu); struct cpu *c = &per_cpu(cpu_devices, cpu);
struct sys_device *s = &c->sysdev; struct sys_device *s = &c->sysdev;
BUG_ON(c->no_control); BUG_ON(!c->hotpluggable);
if (!firmware_has_feature(FW_FEATURE_ISERIES) && if (!firmware_has_feature(FW_FEATURE_ISERIES) &&
cpu_has_feature(CPU_FTR_SMT)) cpu_has_feature(CPU_FTR_SMT))
...@@ -424,10 +424,10 @@ static int __init topology_init(void) ...@@ -424,10 +424,10 @@ static int __init topology_init(void)
* CPU. For instance, the boot cpu might never be valid * CPU. For instance, the boot cpu might never be valid
* for hotplugging. * for hotplugging.
*/ */
if (!ppc_md.cpu_die) if (ppc_md.cpu_die)
c->no_control = 1; c->hotpluggable = 1;
if (cpu_online(cpu) || (c->no_control == 0)) { if (cpu_online(cpu) || c->hotpluggable) {
register_cpu(c, cpu); register_cpu(c, cpu);
sysdev_create_file(&c->sysdev, &attr_physical_id); sysdev_create_file(&c->sysdev, &attr_physical_id);
......
...@@ -104,8 +104,8 @@ static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL); ...@@ -104,8 +104,8 @@ static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL);
/* /*
* register_cpu - Setup a driverfs device for a CPU. * register_cpu - Setup a driverfs device for a CPU.
* @cpu - Callers can set the cpu->no_control field to 1, to indicate not to * @cpu - cpu->hotpluggable field set to 1 will generate a control file in
* generate a control file in sysfs for this CPU. * sysfs for this CPU.
* @num - CPU number to use when creating the device. * @num - CPU number to use when creating the device.
* *
* Initialize and register the CPU device. * Initialize and register the CPU device.
...@@ -119,7 +119,7 @@ int __devinit register_cpu(struct cpu *cpu, int num) ...@@ -119,7 +119,7 @@ int __devinit register_cpu(struct cpu *cpu, int num)
error = sysdev_register(&cpu->sysdev); error = sysdev_register(&cpu->sysdev);
if (!error && !cpu->no_control) if (!error && cpu->hotpluggable)
register_cpu_control(cpu); register_cpu_control(cpu);
if (!error) if (!error)
cpu_sys_devices[num] = &cpu->sysdev; cpu_sys_devices[num] = &cpu->sysdev;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
struct cpu { struct cpu {
int node_id; /* The node which contains the CPU */ int node_id; /* The node which contains the CPU */
int no_control; /* Should the sysfs control file be created? */ int hotpluggable; /* creates sysfs control file if hotpluggable */
struct sys_device sysdev; struct sys_device sysdev;
}; };
......
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