msm: thermal: Update error handling of device offline
When device enters suspend, the suspend framework disables CPU hotplug functionality. During the suspend, any attempt from KTM to hotplug CPU will return error and in this case, KTM wont clear the cpus_offlined mask. In this case, the device framework assumes the core is still online. Next time the device resumes from suspend the core online attempt will be nacked by KTM. Thus the core will be offlined and subsequent attempts to bring the core online using device framework will fail. Update KTM error handling to remove the CPUs from the cpus_offlined mask, when device offline APIs return error. Thus KTM wont block suspend framework from bringing the core online. Also, update KTM not to evaluate new request to offline or online a core when the device is in suspend entry or exit. The re-evaluation will be triggered when the device exits suspend. Change-Id: I334fd782a2c5d604cafb94f44832d9c700891ba2 Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
This commit is contained in:
parent
3162449f7d
commit
f24aac1b25
1 changed files with 11 additions and 2 deletions
|
@ -2931,7 +2931,7 @@ static void __ref do_core_control(int temp)
|
||||||
cpu_dev = get_cpu_device(i);
|
cpu_dev = get_cpu_device(i);
|
||||||
trace_thermal_pre_core_offline(i);
|
trace_thermal_pre_core_offline(i);
|
||||||
ret = device_offline(cpu_dev);
|
ret = device_offline(cpu_dev);
|
||||||
if (ret)
|
if (ret < 0)
|
||||||
pr_err("Error %d offline core %d\n",
|
pr_err("Error %d offline core %d\n",
|
||||||
ret, i);
|
ret, i);
|
||||||
trace_thermal_post_core_offline(i,
|
trace_thermal_post_core_offline(i,
|
||||||
|
@ -3004,7 +3004,8 @@ static int __ref update_offline_cores(int val)
|
||||||
cpu_dev = get_cpu_device(cpu);
|
cpu_dev = get_cpu_device(cpu);
|
||||||
trace_thermal_pre_core_offline(cpu);
|
trace_thermal_pre_core_offline(cpu);
|
||||||
ret = device_offline(cpu_dev);
|
ret = device_offline(cpu_dev);
|
||||||
if (ret) {
|
if (ret < 0) {
|
||||||
|
cpus_offlined &= ~BIT(cpu);
|
||||||
pr_err_ratelimited(
|
pr_err_ratelimited(
|
||||||
"Unable to offline CPU%d. err:%d\n",
|
"Unable to offline CPU%d. err:%d\n",
|
||||||
cpu, ret);
|
cpu, ret);
|
||||||
|
@ -3074,6 +3075,14 @@ static __ref int do_hotplug(void *data)
|
||||||
&hotplug_notify_complete) != 0)
|
&hotplug_notify_complete) != 0)
|
||||||
;
|
;
|
||||||
reinit_completion(&hotplug_notify_complete);
|
reinit_completion(&hotplug_notify_complete);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Suspend framework will have disabled the
|
||||||
|
* hotplug functionality. So wait till the suspend exits
|
||||||
|
* and then re-evaluate.
|
||||||
|
*/
|
||||||
|
if (in_suspend)
|
||||||
|
continue;
|
||||||
mask = 0;
|
mask = 0;
|
||||||
|
|
||||||
mutex_lock(&core_control_mutex);
|
mutex_lock(&core_control_mutex);
|
||||||
|
|
Loading…
Add table
Reference in a new issue