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

Commit 1e227724 authored by Prasad Sodagudi's avatar Prasad Sodagudi
Browse files

cpu-hotplug: Fix the cpus_write_lock usage



'Commit ("5f7b7a9f cpu-hotplug:
Keep atleast 1 online and un-isolated CPU")'
caused regression in CPU hotplug scenario. cpus_write_lock
taken and not released in error path. So fix
the sequence of checks in _cpu_down function.

Change-Id: I96cb3c2f1de93992af0e4f1d85857744b65e7a21
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
parent c3179e5f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -867,11 +867,11 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
	if (!cpu_present(cpu))
		return -EINVAL;

	cpus_write_lock();

	if (!tasks_frozen && !cpu_isolated(cpu) && num_online_uniso_cpus() == 1)
		return -EBUSY;

	cpus_write_lock();

	if (trace_cpuhp_latency_enabled())
		start_time = sched_clock();