提交 f6913f99 编写于 作者: T Toshi Kani 提交者: Rafael J. Wysocki

hotplug / x86: Fix online state in cpu0 debug interface

_debug_hotplug_cpu() is a debug interface that puts cpu0 offline during
boot-up when CONFIG_DEBUG_HOTPLUG_CPU0 is set.  After cpu0 is put offline
in this interface, however, /sys/devices/system/cpu/cpu0/online still
shows 1 (online).

This patch fixes _debug_hotplug_cpu() to update dev->offline when CPU
online/offline operation succeeded.
Signed-off-by: NToshi Kani <toshi.kani@hp.com>
Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 4a10c2ac
...@@ -72,16 +72,19 @@ int __ref _debug_hotplug_cpu(int cpu, int action) ...@@ -72,16 +72,19 @@ int __ref _debug_hotplug_cpu(int cpu, int action)
ret = cpu_down(cpu); ret = cpu_down(cpu);
if (!ret) { if (!ret) {
pr_info("CPU %u is now offline\n", cpu); pr_info("CPU %u is now offline\n", cpu);
dev->offline = true;
kobject_uevent(&dev->kobj, KOBJ_OFFLINE); kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
} else } else
pr_debug("Can't offline CPU%d.\n", cpu); pr_debug("Can't offline CPU%d.\n", cpu);
break; break;
case 1: case 1:
ret = cpu_up(cpu); ret = cpu_up(cpu);
if (!ret) if (!ret) {
dev->offline = false;
kobject_uevent(&dev->kobj, KOBJ_ONLINE); kobject_uevent(&dev->kobj, KOBJ_ONLINE);
else } else {
pr_debug("Can't online CPU%d.\n", cpu); pr_debug("Can't online CPU%d.\n", cpu);
}
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册