Commit a68a29d9 authored by Ashok Raj's avatar Ashok Raj Committed by Linus Torvalds

[PATCH] don't create cpu/online sysfs file

This file provides ability for caller of register_cpu() to either create a
control file, or not.  This can be handy if a particular platform decides
that certain CPU's are not removable.  Hence would like to not create a
control file.
Signed-off-by: default avatarDave Hansen <haveblue@us.ibm.com>
Signed-off-by: default avatarAshok Raj <ashok.raj@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b1b28ddd
...@@ -325,6 +325,16 @@ static int __init topology_init(void) ...@@ -325,6 +325,16 @@ static int __init topology_init(void)
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
parent = &node_devices[cpu_to_node(cpu)]; parent = &node_devices[cpu_to_node(cpu)];
#endif #endif
/*
* For now, we just see if the system supports making
* the RTAS calls for CPU hotplug. But, there may be a
* more comprehensive way to do this for an individual
* CPU. For instance, the boot cpu might never be valid
* for hotplugging.
*/
if (systemcfg->platform != PLATFORM_PSERIES_LPAR)
c->no_control = 1;
register_cpu(c, cpu, parent); register_cpu(c, cpu, parent);
register_cpu_pmc(&c->sysdev); register_cpu_pmc(&c->sysdev);
......
...@@ -58,6 +58,8 @@ static inline void register_cpu_control(struct cpu *cpu) ...@@ -58,6 +58,8 @@ static inline void register_cpu_control(struct cpu *cpu)
/* /*
* 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
* generate a control file in 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.
...@@ -75,7 +77,7 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root) ...@@ -75,7 +77,7 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root)
error = sysfs_create_link(&root->sysdev.kobj, error = sysfs_create_link(&root->sysdev.kobj,
&cpu->sysdev.kobj, &cpu->sysdev.kobj,
kobject_name(&cpu->sysdev.kobj)); kobject_name(&cpu->sysdev.kobj));
if (!error) if (!error && !cpu->no_control)
register_cpu_control(cpu); register_cpu_control(cpu);
return error; return error;
} }
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +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? */
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