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

Commit 73810927 authored by Mahesh Sivasubramanian's avatar Mahesh Sivasubramanian Committed by Srinivas Rao L
Browse files

drivers: cpuidle: lpm-levels: Add support per cluster prediction



Add feature to enable/disable CPU prediction on a cluster level. This
allows more finer tuning based on power/perf requirements.

Change-Id: I1ce26c04fd3a25ee1f724da5814074308484baca
Signed-off-by: default avatarMahesh Sivasubramanian <msivasub@codeaurora.org>
parent 945fd6c8
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,8 @@ that share the parameters.It contains the following properties.
	- qcom,pm-cpu-levels: The different low power modes that a CPU could
	- qcom,pm-cpu-levels: The different low power modes that a CPU could
	enter. The following section explains the required properties of this
	enter. The following section explains the required properties of this
	node.
	node.
	-qcom,use-prediction: This optional property is used to indicate the
	the LPM governor is to apply sleep prediction to this cluster.


[Node bindings for qcom,pm-cpu-levels]
[Node bindings for qcom,pm-cpu-levels]
 Required properties:
 Required properties:
+3 −0
Original line number Original line Diff line number Diff line
@@ -713,6 +713,9 @@ static int parse_cpu_levels(struct device_node *node, struct lpm_cluster *c)
	if (ret)
	if (ret)
		goto failed_parse_params;
		goto failed_parse_params;


	key = "qcom,use-prediction";
	cpu->lpm_prediction = of_property_read_bool(node, key);

	key = "parse_cpu";
	key = "parse_cpu";
	ret = parse_cpu(node, cpu);
	ret = parse_cpu(node, cpu);
	if (ret)
	if (ret)
+2 −2
Original line number Original line Diff line number Diff line
@@ -439,7 +439,7 @@ static uint64_t lpm_cpuidle_predict(struct cpuidle_device *dev,
	uint32_t *min_residency = get_per_cpu_min_residency(dev->cpu);
	uint32_t *min_residency = get_per_cpu_min_residency(dev->cpu);
	uint32_t *max_residency = get_per_cpu_max_residency(dev->cpu);
	uint32_t *max_residency = get_per_cpu_max_residency(dev->cpu);


	if (!lpm_prediction)
	if (!lpm_prediction || !cpu->lpm_prediction)
		return 0;
		return 0;


	/*
	/*
@@ -625,7 +625,7 @@ static int cpu_power_select(struct cpuidle_device *dev,
		struct power_params *pwr_params = &level->pwr;
		struct power_params *pwr_params = &level->pwr;
		bool allow;
		bool allow;


		allow = lpm_cpu_mode_allow(dev->cpu, i, true);
		allow = i ? lpm_cpu_mode_allow(dev->cpu, i, true) : true;


		if (!allow)
		if (!allow)
			continue;
			continue;
+1 −0
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@ struct lpm_cpu {
	int nlevels;
	int nlevels;
	unsigned int psci_mode_shift;
	unsigned int psci_mode_shift;
	unsigned int psci_mode_mask;
	unsigned int psci_mode_mask;
	bool lpm_prediction;
	struct cpuidle_driver *drv;
	struct cpuidle_driver *drv;
	struct lpm_cluster *parent;
	struct lpm_cluster *parent;
};
};