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

Commit e5523bbc authored by Murali Nalajala's avatar Murali Nalajala
Browse files

cpuidle: lpm-levels: Optimize CPU default LPM mode for PSCI



get_cluster_id() returns the power state id which HLOS passes
to PSCI framework to do LPM modes. This function is not needed
to call for default CPU LPM modes. Do not call get_cluster_id()
for default LPM modes.

Change-Id: Ic89b0a9c031e6cecf02ec713783050d079432ae2
Signed-off-by: default avatarMurali Nalajala <mnalajal@codeaurora.org>
parent 729ef8ff
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -752,21 +752,25 @@ unlock_and_return:
#if !defined(CONFIG_CPU_V7)
bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle)
{
	int affinity_level = 0;
	int state_id = get_cluster_id(cluster, &affinity_level);
	int power_state = PSCI_POWER_STATE(cluster->cpu->levels[idx].is_reset);

	affinity_level = PSCI_AFFINITY_LEVEL(affinity_level);
	/*
	 * idx = 0 is the default LPM state
	 */
	if (!idx) {
		wfi();
		return 1;
	} else {
		int affinity_level = 0;
		int state_id = get_cluster_id(cluster, &affinity_level);
		int power_state =
			PSCI_POWER_STATE(cluster->cpu->levels[idx].is_reset);

		affinity_level = PSCI_AFFINITY_LEVEL(affinity_level);
		state_id |= (power_state | affinity_level
			| cluster->cpu->levels[idx].psci_id);
	}

		return !cpu_suspend(state_id);
	}
}
#else
bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle)
{