Skip to content

Commit

Permalink
CPU: Fix sysfs cpu/online of offlined CPUs
Browse files Browse the repository at this point in the history
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 <dave.hansen@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Toshi Kani authored and Rafael J. Wysocki committed May 29, 2013
1 parent 4960e05 commit 1001b4d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/base/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1001b4d

Please sign in to comment.