cpu: send KOBJ_ONLINE event when enabling cpus

In case some sysfs nodes needs to be labeled with a different label than
sysfs then user needs to be notified when a core is brought back online.

Bug: 29359497
Change-Id: I0395c86e01cd49c348fda8f93087d26f88557c91
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Git-commit: fda281a64c7da7b5c634703d22a240a79c337992
Git-repo: https://android.googlesource.com/kernel/common.git
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
This commit is contained in:
Thierry Strudel 2016-06-14 17:46:44 -07:00 committed by Gerrit - the friendly Code Review server
parent cb5b5db1cf
commit 572920898f
1 changed files with 7 additions and 0 deletions

View File

@ -547,6 +547,7 @@ void __weak arch_enable_nonboot_cpus_end(void)
void __ref enable_nonboot_cpus(void)
{
int cpu, error;
struct device *cpu_device;
/* Allow everyone to use the CPU hotplug again */
cpu_maps_update_begin();
@ -562,6 +563,12 @@ void __ref enable_nonboot_cpus(void)
error = _cpu_up(cpu, 1);
if (!error) {
printk(KERN_INFO "CPU%d is up\n", cpu);
cpu_device = get_cpu_device(cpu);
if (!cpu_device)
pr_err("%s: failed to get cpu%d device\n",
__func__, cpu);
else
kobject_uevent(&cpu_device->kobj, KOBJ_ONLINE);
continue;
}
printk(KERN_WARNING "Error taking CPU%d up: %d\n", cpu, error);