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

Commit fa069100 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: Save and restore cpu ctis on L2 SCU power transition"

parents 0153f373 5b3a3648
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <linux/remote_spinlock.h>
#include <linux/msm_remote_spinlock.h>
#include <linux/dma-mapping.h>
#include <linux/coresight-cti.h>
#include <soc/qcom/spm.h>
#include <soc/qcom/pm.h>
#include <soc/qcom/rpm-notifier.h>
@@ -178,18 +179,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;

	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;
		}
		break;
	default:
		lpm = MSM_SPM_MODE_DISABLED;