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

Commit 77a1c447 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Gerrit - the friendly Code Review server
Browse files

core_ctl: Take state_lock while preparing the global_state



global_state file output is prepared by reading the members of CPU
and cluster data structures. These members are updated under state_lock,
so acquire the same lock while preparing the output.

Change-Id: I92c4103a61102f98911b269f2a527707003f5cf6
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent c1f5c2d9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -264,6 +264,7 @@ static ssize_t show_global_state(const struct cluster_data *state, char *buf)
	ssize_t count = 0;
	unsigned int cpu;

	spin_lock_irq(&state_lock);
	for_each_possible_cpu(cpu) {
		c = &per_cpu(cpu_state, cpu);
		cluster = c->cluster;
@@ -299,6 +300,7 @@ static ssize_t show_global_state(const struct cluster_data *state, char *buf)
		count += snprintf(buf + count, PAGE_SIZE - count,
				"\tBoost: %u\n", (unsigned int) cluster->boost);
	}
	spin_unlock_irq(&state_lock);

	return count;
}