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

Commit 415326a0 authored by Archana Sathyakumar's avatar Archana Sathyakumar
Browse files

msm: spm: Replace smp_processor_id call with get_cpu



Spm_processor_id call results in warning message when
called with preempt enabled. Instead call get_cpu to get
the current cpu ID and enable preempt again because the
function further calls smp_call_function_single which
disables preempt within.

Change-Id: I246f26b023da97038c5d6b675a820f07ac62fda1
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent f7e6c0cd
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -82,12 +82,14 @@ int msm_spm_set_vdd(unsigned int cpu, unsigned int vlevel)
{
	struct msm_spm_vdd_info info;
	int ret;
	int current_cpu;

	info.cpu = cpu;
	info.vlevel = vlevel;
	info.err = -ENODEV;

	if (!msm_spm_L2_apcs_master && (smp_processor_id() != cpu) &&
	current_cpu = get_cpu();
	if (!msm_spm_L2_apcs_master && (current_cpu != cpu) &&
			cpu_online(cpu)) {
		/**
		 * We do not want to set the voltage of another core from
@@ -109,6 +111,7 @@ int msm_spm_set_vdd(unsigned int cpu, unsigned int vlevel)
		msm_spm_smp_set_vdd(&info);
		ret = info.err;
	}
	put_cpu();

	return ret;
}