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

Commit 82892856 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm-core: Fix race with userspace updating power numbers"

parents 3961853c 66ed4d93
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -397,6 +397,7 @@ static int update_userspace_power(struct sched_params __user *argp)
	/* Copy the same power values for all the cpus in the cpumask
	 * argp->cpumask within the cluster (argp->cluster)
	 */
	spin_lock(&update_lock);
	cpumask = argp->cpumask;
	for (i = 0; i < MAX_CORES_PER_CLUSTER; i++, cpumask >>= 1) {
		if (!(cpumask & 0x01))
@@ -419,6 +420,7 @@ static int update_userspace_power(struct sched_params __user *argp)
			repopulate_stats(cpu);
		}
	}
	spin_unlock(&update_lock);

	activate_power_table = true;
	return 0;