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

Commit 735e1e7d authored by Maulik Shah's avatar Maulik Shah Committed by Gerrit - the friendly Code Review server
Browse files

drivers: lpm-levels-legacy: Allow rpm handshake only with cluster LPM



CPU spm is programmed to handshake with rpm for single cpu devices.
If cluster level LPM is not selected even then spm handshakes with
rpm.

Fix this issue by allowing rpm handshake only if cluster level
LPM is selected.

CRs-Fixed: 1043098
Change-Id: I54babda27ecf7a931f844b8c7219a9582221abca
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
Signed-off-by: default avatarChinkit Kumar,Kirti Kumar Parmar <parma@codeaurora.org>
parent 3b237172
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -646,6 +646,9 @@ static int cluster_configure(struct lpm_cluster *cluster, int idx,
		if (sys_pm_ops && sys_pm_ops->enter)
			if ((sys_pm_ops->enter(nextcpu)))
				return -EBUSY;

		if (cluster->no_saw_devices && !use_psci)
			msm_spm_set_rpm_hs(true);
	}

	/* Notify cluster enter event after successfully config completion */
@@ -777,6 +780,9 @@ static void cluster_unprepare(struct lpm_cluster *cluster,
		 */
		lpm_wa_cx_unvote_send();

		if (cluster->no_saw_devices && !use_psci)
			msm_spm_set_rpm_hs(false);

	}

	update_debug_pc_event(CLUSTER_EXIT, cluster->last_level,
+8 −0
Original line number Diff line number Diff line
@@ -545,6 +545,14 @@ int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm)
}
EXPORT_SYMBOL(msm_spm_set_low_power_mode);

void msm_spm_set_rpm_hs(bool allow_rpm_hs)
{
	struct msm_spm_device *dev = this_cpu_ptr(&msm_cpu_spm_device);

	dev->allow_rpm_hs = allow_rpm_hs;
}
EXPORT_SYMBOL(msm_spm_set_rpm_hs);

int msm_spm_config_low_power_mode_addr(struct msm_spm_device *dev,
		unsigned int mode, bool notify_rpm)
{
+3 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ struct device_node;
#if defined(CONFIG_MSM_SPM)

int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm);
void msm_spm_set_rpm_hs(bool allow_rpm_hs);
int msm_spm_probe_done(void);
int msm_spm_set_vdd(unsigned int cpu, unsigned int vlevel);
int msm_spm_get_vdd(unsigned int cpu);
@@ -82,6 +83,8 @@ static inline int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm)
	return -ENODEV;
}

static inline void msm_spm_set_rpm_hs(bool allow_rpm_hs) {}

static inline int msm_spm_probe_done(void)
{
	return -ENODEV;