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

Commit 58109805 authored by Mahesh Sivasubramanian's avatar Mahesh Sivasubramanian
Browse files

msm: lpm_levels: Fix logic for choosing cpu mode



When "qcom,allow-synched-level" flag is not defined, the cpu low power
modes that need to be synchronized with the cluster mode are not chosen.
This could result in sub optimal power savings. Fix by disallowing
system low power modes and allowing CPU low power modes.

Change-Id: I3d37054e785cdd3c3e6ded252e351d24a5ff9130
Signed-off-by: default avatarMahesh Sivasubramanian <msivasub@codeaurora.org>
parent 94c52e4c
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -276,6 +276,16 @@ static int lpm_system_mode_select(struct lpm_system_state *system_state,
		if (!system_level->available)
			continue;

		/* The following check is to support legacy behavior where
		 * only the last online core enters a system low power mode.
		 * This should eventually be removed once all targets support
		 * system low power modes with multiple cores online.
		 */
		if (system_level->sync_level
				&& (num_online_cpus() > 1)
				&& !sys_state.allow_synched_levels)
			continue;

		if (system_level->sync_level &&
			!cpumask_equal(&system_level->num_cpu_votes,
					&num_powered_cores))
@@ -529,16 +539,6 @@ static int lpm_cpu_power_select(struct cpuidle_device *dev, int *index)
		enum msm_pm_sleep_mode mode = level->mode;
		bool allow;

		/* The following check is to support legacy behavior where
		 * only the last online core enters a system low power mode.
		 * This should eventually be removed once all targets support
		 * system low power modes with multiple cores online.
		 */
		if ((level->mode >= sys_state.sync_cpu_mode)
				&& (num_online_cpus() > 1)
				&& !sys_state.allow_synched_levels)
			continue;

		allow = msm_pm_sleep_mode_allow(dev->cpu, mode, true);

		if (!allow)