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)
#ifdef CONFIG_NUMA
parent = &node_devices[cpu_to_node(cpu)];
#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_pmc(&c->sysdev);
......
......@@ -58,6 +58,8 @@ static inline void register_cpu_control(struct cpu *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.
*
* Initialize and register the CPU device.
......@@ -75,7 +77,7 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root)
error = sysfs_create_link(&root->sysdev.kobj,
&cpu->sysdev.kobj,
kobject_name(&cpu->sysdev.kobj));
if (!error)
if (!error && !cpu->no_control)
register_cpu_control(cpu);
return error;
}
......
......@@ -27,6 +27,7 @@
struct cpu {
int node_id; /* The node which contains the CPU */
int no_control; /* Should the sysfs control file be created? */
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