aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/cpu.c
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2012-01-25 18:09:14 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-26 19:49:08 -0500
commitfad12ac8c8c2591c7f4e61d19b6a9d76cd49fafa (patch)
treee2a77737265a193bbec7ecfd08f4989931a0ba89 /drivers/base/cpu.c
parent78ff123b05fb15beb1ad670372eea0d299d0b8af (diff)
CPU: Introduce ARCH_HAS_CPU_AUTOPROBE and X86 parts
This patch is based on Andi Kleen's work: Implement autoprobing/loading of modules serving CPU specific features (x86cpu autoloading). And Kay Siever's work to get rid of sysdev cpu structures and making use of struct device instead. Before, the cpuid driver had to be loaded to get the x86cpu autoloading feature. With this patch autoloading works through the /sys/devices/system/cpu object Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Dave Jones <davej@redhat.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Huang Ying <ying.huang@intel.com> Cc: Len Brown <lenb@kernel.org> Acked-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Thomas Renninger <trenn@suse.de> Acked-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/cpu.c')
-rw-r--r--drivers/base/cpu.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index db87e78d7459..2a0c670c281d 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -11,6 +11,7 @@
11#include <linux/device.h> 11#include <linux/device.h>
12#include <linux/node.h> 12#include <linux/node.h>
13#include <linux/gfp.h> 13#include <linux/gfp.h>
14#include <linux/slab.h>
14#include <linux/percpu.h> 15#include <linux/percpu.h>
15 16
16#include "base.h" 17#include "base.h"
@@ -223,6 +224,9 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
223 cpu->node_id = cpu_to_node(num); 224 cpu->node_id = cpu_to_node(num);
224 cpu->dev.id = num; 225 cpu->dev.id = num;
225 cpu->dev.bus = &cpu_subsys; 226 cpu->dev.bus = &cpu_subsys;
227#ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
228 cpu->dev.bus->uevent = arch_cpu_uevent;
229#endif
226 error = device_register(&cpu->dev); 230 error = device_register(&cpu->dev);
227 if (!error && cpu->hotpluggable) 231 if (!error && cpu->hotpluggable)
228 register_cpu_control(cpu); 232 register_cpu_control(cpu);
@@ -247,6 +251,10 @@ struct device *get_cpu_device(unsigned cpu)
247} 251}
248EXPORT_SYMBOL_GPL(get_cpu_device); 252EXPORT_SYMBOL_GPL(get_cpu_device);
249 253
254#ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
255static DEVICE_ATTR(modalias, 0444, arch_print_cpu_modalias, NULL);
256#endif
257
250static struct attribute *cpu_root_attrs[] = { 258static struct attribute *cpu_root_attrs[] = {
251#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE 259#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
252 &dev_attr_probe.attr, 260 &dev_attr_probe.attr,
@@ -257,6 +265,9 @@ static struct attribute *cpu_root_attrs[] = {
257 &cpu_attrs[2].attr.attr, 265 &cpu_attrs[2].attr.attr,
258 &dev_attr_kernel_max.attr, 266 &dev_attr_kernel_max.attr,
259 &dev_attr_offline.attr, 267 &dev_attr_offline.attr,
268#ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
269 &dev_attr_modalias.attr,
270#endif
260 NULL 271 NULL
261}; 272};
262 273