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

Commit 5d7fd3cf authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: lpm-levels: Fix issue with coresight save/restore"

parents 4caa51c4 b15fe8e0
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -189,29 +189,27 @@ int set_l2_mode(struct low_power_ops *ops, int mode, bool notify_rpm)
{
	int lpm = mode;
	int rc = 0;
	static bool coresight_saved;

	ops->tz_flag = MSM_SCM_L2_ON;
	if (ops->tz_flag == MSM_SCM_L2_OFF ||
			ops->tz_flag == MSM_SCM_L2_GDHS)
		coresight_cti_ctx_restore();


	switch (mode) {
	case MSM_SPM_MODE_POWER_COLLAPSE:
		ops->tz_flag = MSM_SCM_L2_OFF;
		coresight_cti_ctx_save();
		coresight_saved = true;
		break;
	case MSM_SPM_MODE_GDHS:
		ops->tz_flag = MSM_SCM_L2_GDHS;
		coresight_cti_ctx_save();
		coresight_saved = true;
		break;
	case MSM_SPM_MODE_RETENTION:
	case MSM_SPM_MODE_DISABLED:
		if (coresight_saved) {
			coresight_cti_ctx_restore();
			coresight_saved = false;
		}
		ops->tz_flag = MSM_SCM_L2_ON;
		break;
	default:
		ops->tz_flag = MSM_SCM_L2_ON;
		lpm = MSM_SPM_MODE_DISABLED;
		break;
	}