Re: [PATCH 2.6.6-rc2 RFT] Add's class support to cpuid.c

Zwane Mwaikambo
2004-06-09T02:50:32Z

On Tue, 8 Jun 2004, Hanna Linder wrote:

> +static void cpuid_class_simple_device_remove(void)
> +{
> + int i = 0;
> + for_each_online_cpu(i)
> + class_simple_device_remove(MKDEV(CPUID_MAJOR, i));
> + return;
> +}

My understanding is that the above removes the class for each online cpu.

> +static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
> +{
> + unsigned int cpu = (unsigned long)hcpu;
> +
> + switch(action) {
> + case CPU_ONLINE:
> + cpuid_class_simple_device_add(cpu);
> + break;
> + case CPU_DEAD:
> + cpuid_class_simple_device_remove();
> + break;

So the above will remove the class for all online processors when one
processor goes down? By the way, you can use i386 SMP to test cpu hotplug
code paths.

Zwane