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

Commit 2ed4d587 authored by Maulik Shah's avatar Maulik Shah
Browse files

cpuidle: lpm-levels: Log cpu enter & exit events into lpm debug



Add cpu enter and cpu exit log into lpm debug for 32bit.

Change-Id: I88973dbc4f9ffc08f8201059a82a3133fa0db330
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent 422bb915
Loading
Loading
Loading
Loading
+20 −9
Original line number Diff line number Diff line
@@ -972,20 +972,31 @@ bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle)
#elif defined(CONFIG_ARM_PSCI)
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);
	if (!idx) {
		stop_critical_timings();
		wfi();
		start_critical_timings();
		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);
		bool success = false;

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

	return !cpu_suspend(state_id);
		update_debug_pc_event(CPU_ENTER, state_id,
						0xdeaffeed, 0xdeaffeed, true);
		stop_critical_timings();
		success = !cpu_suspend(state_id);
		start_critical_timings();
		update_debug_pc_event(CPU_EXIT, state_id,
						success, 0xdeaffeed, true);
		return success;
	}
}
#else
bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle)