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

Commit 1f5a5121 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: Activate ptable only on userspace power update"

parents e57ba5c5 d1b6f871
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -196,10 +196,11 @@ static int msm_core_ptable_read(struct seq_file *m, void *data)
			cpu, node->enabled == 1 ? "Enabled" : "Written");
			print_table(m, node->head, node->len);
		}
		if (node->driver_data) {
		if (msm_core_data[cpu].ptable) {
			seq_printf(m, "--- CPU%d - Live numbers at %ldC---\n",
			cpu, node->ptr->temp);
			print_table(m, node->driver_data, node->driver_len);
			print_table(m, msm_core_data[cpu].ptable,
					msm_core_data[cpu].len);
		}
	}
	return 0;
+7 −5
Original line number Diff line number Diff line
@@ -111,6 +111,8 @@ module_param_named(polling_interval, poll_ms, int,
static int disabled;
module_param_named(disabled, disabled, int,
		S_IRUGO | S_IWUSR | S_IWGRP);

static bool activate_power_table;
/*
 * Cannot be called from an interrupt context
 */
@@ -206,6 +208,7 @@ void trigger_cpu_pwr_stats_calc(void)
			sensor_get_temp(cpu_node->sensor_id, &cpu_node->temp);
		prev_temp[cpu] = cpu_node->temp;

		if (activate_power_table)
			repopulate_stats(cpu);
	}
	spin_unlock(&update_lock);
@@ -335,11 +338,12 @@ static int update_userspace_power(struct sched_params __user *argp)
				cpumask_clear_cpu(cpu, &clear_sp->mask);
				clear_static_power(clear_sp);
			}
			cpu_stats[cpu].ptable = per_cpu(ptable, cpu);
			repopulate_stats(cpu);
		}
	}

	for_each_possible_cpu(cpu)
		repopulate_stats(cpu);
	activate_power_table = true;
	return 0;

failed:
@@ -456,8 +460,6 @@ static int msm_core_stats_init(struct device *dev)
			pstate[i].freq = cpu_node->sp->table[i].frequency;

		per_cpu(ptable, cpu) = pstate;
		cpu_stats[cpu].ptable = per_cpu(ptable, cpu);
		repopulate_stats(cpu);
	}
	return 0;
}