From 26348f7fa6e57b2fd7c3dff9fc7bfd0f8de90b7b Mon Sep 17 00:00:00 2001 From: Siqi Lin Date: Wed, 25 May 2016 17:36:47 -0700 Subject: [PATCH] msm_thermal: send OFF/ONLINE uevent in hotplug cases Send the correct uevent after setting a CPU core online or offline. This allows ueventd to set correct SELinux labels for newly created sysfs CPU device nodes. Bug: 28887345 Change-Id: If31b8529b31de9544914e27514aca571039abb60 Signed-off-by: Siqi Lin Signed-off-by: Thierry Strudel --- drivers/thermal/msm_thermal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/thermal/msm_thermal.c b/drivers/thermal/msm_thermal.c index 44059bfd119a..2c8dc3ecc20e 100644 --- a/drivers/thermal/msm_thermal.c +++ b/drivers/thermal/msm_thermal.c @@ -2831,6 +2831,8 @@ static int __ref update_offline_cores(int val) cpu, ret); pend_hotplug_req = true; } else { + struct device *cpu_device = get_cpu_device(cpu); + kobject_uevent(&cpu_device->kobj, KOBJ_OFFLINE); pr_debug("Offlined CPU%d\n", cpu); } trace_thermal_post_core_offline(cpu, @@ -2853,6 +2855,8 @@ static int __ref update_offline_cores(int val) "Unable to online CPU%d. err:%d\n", cpu, ret); } else { + struct device *cpu_device = get_cpu_device(cpu); + kobject_uevent(&cpu_device->kobj, KOBJ_ONLINE); pr_debug("Onlined CPU%d\n", cpu); } trace_thermal_post_core_online(cpu,