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

Commit 035f9ea4 authored by Mahesh Sivasubramanian's avatar Mahesh Sivasubramanian
Browse files

Revert "msm: lpm_levels: Adjust latency for Multi core cases"



This reverts commit b4e82b5c. The
performance and power benefits seen with this patch were minimal that it
can be reverted

Change-Id: I2ef897509610a902f7029766e2be0ab441e76bdd
Signed-off-by: default avatarMahesh Sivasubramanian <msivasub@codeaurora.org>
parent 1d202808
Loading
Loading
Loading
Loading
+13 −31
Original line number Diff line number Diff line
@@ -65,10 +65,6 @@ static ssize_t msm_lpm_levels_attr_show(
static ssize_t msm_lpm_levels_attr_store(struct kobject *kobj,
	struct kobj_attribute *attr, const char *buf, size_t count);

#define ADJUST_LATENCY(x)	\
	((x == MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE) ?\
		(num_online_cpus()) / 2 : 0)

static int msm_lpm_lvl_dbg_msk;

module_param_named(
@@ -344,9 +340,6 @@ static void *msm_lpm_lowest_limits(bool from_idle,
	int i;
	bool modify_event_timer;
	uint32_t next_wakeup_us = time_param->sleep_us;
	uint32_t lvl_latency_us = 0;
	uint32_t lvl_overhead_us = 0;
	uint32_t lvl_overhead_energy = 0;

	if (!msm_lpm_levels)
		return NULL;
@@ -362,36 +355,24 @@ static void *msm_lpm_lowest_limits(bool from_idle,
		if (sleep_mode != level->sleep_mode)
			continue;

		lvl_latency_us =
			level->latency_us + (level->latency_us *
						ADJUST_LATENCY(sleep_mode));

		lvl_overhead_us =
			level->time_overhead_us + (level->time_overhead_us *
						ADJUST_LATENCY(sleep_mode));

		lvl_overhead_energy =
			level->energy_overhead + level->energy_overhead *
						ADJUST_LATENCY(sleep_mode);

		if (time_param->latency_us < lvl_latency_us)
		if (time_param->latency_us < level->latency_us)
			continue;

		if (time_param->next_event_us &&
			time_param->next_event_us < lvl_latency_us)
			time_param->next_event_us < level->latency_us)
			continue;

		if (time_param->next_event_us) {
			if ((time_param->next_event_us < time_param->sleep_us)
			|| ((time_param->next_event_us - lvl_latency_us) <
			|| ((time_param->next_event_us - level->latency_us) <
				time_param->sleep_us)) {
				modify_event_timer = true;
				next_wakeup_us = time_param->next_event_us -
						lvl_latency_us;
						level->latency_us;
			}
		}

		if (next_wakeup_us <= lvl_overhead_us)
		if (next_wakeup_us <= level->time_overhead_us)
			continue;

		if ((MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE == sleep_mode)
@@ -400,21 +381,22 @@ static void *msm_lpm_lowest_limits(bool from_idle,
					break;

		if (next_wakeup_us <= 1) {
			pwr = lvl_overhead_energy;
		} else if (next_wakeup_us <= lvl_overhead_us) {
			pwr = lvl_overhead_energy / next_wakeup_us;
			pwr = level->energy_overhead;
		} else if (next_wakeup_us <= level->time_overhead_us) {
			pwr = level->energy_overhead / next_wakeup_us;
		} else if ((next_wakeup_us >> 10)
				> lvl_overhead_us) {
				> level->time_overhead_us) {
			pwr = level->steady_state_power;
		} else {
			pwr = level->steady_state_power;
			pwr -= (lvl_overhead_us *
			pwr -= (level->time_overhead_us *
				level->steady_state_power) /
						next_wakeup_us;
			pwr += lvl_overhead_energy / next_wakeup_us;
			pwr += level->energy_overhead / next_wakeup_us;
		}

		if (!best_level || (best_level_pwr >= pwr)) {

			best_level = level;
			best_level_pwr = pwr;
			if (power)
@@ -424,7 +406,7 @@ static void *msm_lpm_lowest_limits(bool from_idle,
					MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT))
				time_param->modified_time_us =
					time_param->next_event_us -
						lvl_latency_us;
						best_level->latency_us;
			else
				time_param->modified_time_us = 0;
		}