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

Commit 1c3ce913 authored by Archana Sathyakumar's avatar Archana Sathyakumar
Browse files

msm: lpm: Fix cpu and cluster pm notifications



Issue:
System hangs as soon as USB is unplugged from the device.
Cpu pm notifications are to be sent only in the power collapse path,
but it is sent when cpu enters any low power modes. This results in
undesired and unexpected behavior.

Send cpu pm notifications only for power collapse and idle path.

Change-Id: I779152cd05c65b116e9ac88856de729c1212fe16
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent 6721e9e5
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -475,7 +475,7 @@ static int cluster_configure(struct lpm_cluster *cluster, int idx,
		/*
		 * Notify that the cluster is entering a low power mode
		 */
		if (level->mode[i] == MSM_SPM_MODE_POWER_COLLAPSE)
		if (level->mode[i] == MSM_PM_SLEEP_MODE_POWER_COLLAPSE)
			cpu_cluster_pm_enter();
	}
	if (level->notify_rpm) {
@@ -617,7 +617,7 @@ static void cluster_unprepare(struct lpm_cluster *cluster,
		BUG_ON(ret);

		if (cluster->levels[last_level].mode[i] ==
				MSM_SPM_MODE_POWER_COLLAPSE)
				MSM_PM_SLEEP_MODE_POWER_COLLAPSE)
			cpu_cluster_pm_exit();
	}
unlock_return:
@@ -645,6 +645,10 @@ static inline void cpu_prepare(struct lpm_cluster *cluster, int cpu_index,
	if (from_idle && (cpu_level->use_bc_timer ||
			(cpu_index >= cluster->min_child_level)))
		clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);

	if (from_idle && ((cpu_level->mode == MSM_PM_SLEEP_MODE_POWER_COLLAPSE)
		|| (cpu_level->mode ==
			MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)))
		cpu_pm_enter();
}

@@ -657,6 +661,10 @@ static inline void cpu_unprepare(struct lpm_cluster *cluster, int cpu_index,
	if (from_idle && (cpu_level->use_bc_timer ||
			(cpu_index >= cluster->min_child_level)))
		clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);

	if (from_idle && ((cpu_level->mode == MSM_PM_SLEEP_MODE_POWER_COLLAPSE)
		|| (cpu_level->mode ==
			MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)))
		cpu_pm_exit();
}