Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e342027 authored by Mahesh Sivasubramanian's avatar Mahesh Sivasubramanian
Browse files

msm: lpm_levels: Allow hotplug even if the driver hasn't been probed.



When the system runs into a thermal condition, the kernel thermal module
tries to hotplug the core before lpm probe is initialized. If lpm probe
isn't initialized the power collapse modes are not chosen for hotplug and
the thermal condition isn't mitigated resulting in a thermal reset. Fix
issue by choosing the deepest sleep mode for a given cpu.

CRs-fixed:609769
Change-Id: I4f724ba4f682c640ffde5686b8e194a4de6808f8
Signed-off-by: default avatarMahesh Sivasubramanian <msivasub@codeaurora.org>
parent 816351dd
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -784,14 +784,19 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,

void lpm_cpu_hotplug_enter(unsigned int cpu)
{
	int i;
	for (i = sys_state.num_cpu_levels - 1; i >= 0; i--) {
		bool allow = msm_pm_sleep_mode_allow(cpu,
				sys_state.cpu_level[i].mode, false);
		if (allow)
			msm_cpu_pm_enter_sleep(sys_state.cpu_level[i].mode,
					false);
	}
	enum msm_pm_sleep_mode mode = MSM_PM_SLEEP_MODE_NR;

	if (msm_pm_sleep_mode_allow(cpu, MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
				false))
		mode = MSM_PM_SLEEP_MODE_POWER_COLLAPSE;
	else if (msm_pm_sleep_mode_allow(cpu,
			MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, false))
		mode = MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE;
	else
		__WARN_printf("Power collapse modes not enabled for hotpug\n");

	if (mode < MSM_PM_SLEEP_MODE_NR)
		msm_cpu_pm_enter_sleep(mode, false);
}

static int lpm_suspend_enter(suspend_state_t state)