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

Commit 135cb1e4 authored by Maulik Shah's avatar Maulik Shah
Browse files

drivers: lpm-levels: 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>
parent 816587b4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -666,6 +666,9 @@ static int cluster_configure(struct lpm_cluster *cluster, int idx,
		us = us + 1;
		do_div(us, USEC_PER_SEC/SCLK_HZ);
		msm_mpm_enter_sleep(us, from_idle, cpumask);

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

	/* Notify cluster enter event after successfully config completion */
@@ -790,6 +793,9 @@ static void cluster_unprepare(struct lpm_cluster *cluster,

		lpm_wa_cx_unvote_send();
		msm_mpm_exit_sleep(from_idle);

		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
@@ -543,6 +543,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 = &__get_cpu_var(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)
{
+6 −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,11 @@ static inline int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm)
	return -ENOSYS;
}

static inline void msm_spm_set_rpm_hs(bool allow_rpm_hs)
{
	return -ENOSYS;
}

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