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

Commit f24bd3dc authored by Puja Gupta's avatar Puja Gupta
Browse files

ANDROID: Streamline sched_domain_energy_f functions



There is no need to print out if there is no sched group energy for a
sched domain.

It is e.g. perfectly fine to have an Energy Model on MC and DIE level
and not on SYSTEM level.

The Energy Model consistency check between sched domains is done in
init_sched_groups_energy(): In case a sched domain level l has energy
data its child sched domain level has to have energy data too.

Change-Id: Idda1a5f895584ce11c4c7a6a18f7fc577b6ae3f8
Signed-off-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
Git-commit: d97484219c9be0ea84a1c3138196e17518420f63
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarPuja Gupta <pujag@codeaurora.org>
parent 59316b8f
Loading
Loading
Loading
Loading
+2 −17
Original line number Diff line number Diff line
@@ -31,31 +31,16 @@
#include <asm/cputype.h>
#include <asm/topology.h>

/* sd energy functions */
static inline
const struct sched_group_energy * const cpu_core_energy(int cpu)
{
	struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL0];

	if (sched_is_energy_aware() && !sge) {
		pr_warn("Invalid sched_group_energy for CPU%d\n", cpu);
		return NULL;
	}

	return sge;
	return sge_array[cpu][SD_LEVEL0];
}

static inline
const struct sched_group_energy * const cpu_cluster_energy(int cpu)
{
	struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL1];

	if (sched_is_energy_aware() && !sge) {
		pr_warn("Invalid sched_group_energy for Cluster%d\n", cpu);
		return NULL;
	}

	return sge;
	return sge_array[cpu][SD_LEVEL1];
}

/*
+3 −24
Original line number Diff line number Diff line
@@ -308,40 +308,19 @@ static int cpu_flags(void)
static inline
const struct sched_group_energy * const cpu_core_energy(int cpu)
{
	struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL0];

	if (sched_is_energy_aware() && !sge) {
		pr_warn("Invalid sched_group_energy for CPU%d\n", cpu);
		return NULL;
	}

	return sge;
	return sge_array[cpu][SD_LEVEL0];
}

static inline
const struct sched_group_energy * const cpu_cluster_energy(int cpu)
{
	struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL1];

	if (sched_is_energy_aware() && !sge) {
		pr_warn("Invalid sched_group_energy for Cluster%d\n", cpu);
		return NULL;
	}

	return sge;
	return sge_array[cpu][SD_LEVEL1];
}

static inline
const struct sched_group_energy * const cpu_system_energy(int cpu)
{
	struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL2];

	if (sched_is_energy_aware() && !sge) {
		pr_warn("Invalid sched_group_energy for System%d\n", cpu);
		return NULL;
	}

	return sge;
	return sge_array[cpu][SD_LEVEL2];
}

static void update_cpu_capacity(unsigned int cpu)