From: Toshi Kani Date: Wed, 29 May 2013 22:30:05 +0000 (+0200) Subject: CPU: Fix sysfs cpu/online of offlined CPUs X-Git-Tag: v3.11-rc1~101^2~5^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1001b4d4a8ee6b2e7a6078a02ccdf68f91b192bd;p=profile%2Fivi%2Fkernel-x86-ivi.git CPU: Fix sysfs cpu/online of offlined CPUs As reported by Dave Hansen, sysfs cpu/online shows 1 for offlined CPUs at boot. Fix this problem by initializing dev.offline with cpu_online() when registering a CPU. References: https://lkml.org/lkml/2013/5/29/403 Reported-and-tested-by: Dave Hansen Signed-off-by: Toshi Kani Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 7431ba6..1d110dc6 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -265,6 +265,7 @@ int __cpuinit register_cpu(struct cpu *cpu, int num) cpu->dev.bus = &cpu_subsys; cpu->dev.release = cpu_device_release; cpu->dev.offline_disabled = !cpu->hotpluggable; + cpu->dev.offline = !cpu_online(num); #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE cpu->dev.bus->uevent = arch_cpu_uevent; #endif