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

Commit a7a30265 authored by Archana Sathyakumar's avatar Archana Sathyakumar
Browse files

msm-core: Provide information about throttling condition



Prevent scheduler from scheduling tasks on a cpu that is nearing
throttling condition. Add a flag that provides this information to the
scheduler.

Change-Id: Iec0956a0bd65d72251d2377794a6f27a9d46003f
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent 6721e9e5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -27,6 +27,10 @@ Optional properties:
                 is no change in threshold. If this property is not
                 present, the power is recalculated only on
                 temperature threshold notifications.
-qcom,throttling-temp: Temperature threshold for cpu frequency mitigation.
                 The value should be set same as the threshold temperature
                 in thermal module - 5 C, such that there is a bandwidth to
                 control the cores before frequency mitigation happens.

[Second level nodes]
Required properties to define per core characteristics:
+11 −0
Original line number Diff line number Diff line
@@ -116,6 +116,10 @@ module_param_named(disabled, disabled, int,
		S_IRUGO | S_IWUSR | S_IWGRP);
static bool in_suspend;
static bool activate_power_table;
static int max_throttling_temp = 80; /* in C */
module_param_named(throttling_temp, max_throttling_temp, int,
		S_IRUGO | S_IWUSR | S_IWGRP);

/*
 * Cannot be called from an interrupt context
 */
@@ -183,6 +187,8 @@ static void repopulate_stats(int cpu)
		temp_point = (cpu_node->temp - TEMP_BASE_POINT) / 5;

	cpu_stats[cpu].temp = cpu_node->temp;
	cpu_stats[cpu].throttling = cpu_node->temp >= max_throttling_temp ?
					true : false;
	for (i = 0; i < cpu_node->sp->num_of_freqs; i++)
		pt[i].power = cpu_node->sp->power[temp_point][i];

@@ -492,6 +498,8 @@ static int msm_core_stats_init(struct device *dev, int cpu)
	cpu_node = &activity[cpu];
	cpu_stats[cpu].cpu = cpu;
	cpu_stats[cpu].temp = cpu_node->temp;
	cpu_stats[cpu].throttling = cpu_node->temp >= max_throttling_temp ?
					true : false;

	cpu_stats[cpu].len = cpu_node->sp->num_of_freqs;
	pstate = devm_kzalloc(dev,
@@ -919,6 +927,9 @@ static int msm_core_dev_probe(struct platform_device *pdev)
	if (ret)
		pr_info("msm-core initialized without polling period\n");

	key = "qcom,throttling-temp";
	ret = of_property_read_u32(node, key, &max_throttling_temp);

	ret = msm_core_freq_init();
	if (ret)
		return ret;
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ struct cpu_pstate_pwr {
struct cpu_pwr_stats {
	int cpu;
	long temp;
	bool throttling;
	struct cpu_pstate_pwr *ptable;
	int len;
};