From: Daeyeong Lee Date: Tue, 13 Feb 2018 11:25:25 +0000 (+0900) Subject: [COMMON] soc: samsung: topology: Add cpu_coregroup_energy X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ae9a616649c4c28bcaa1054081ebac436c921043;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] soc: samsung: topology: Add cpu_coregroup_energy Change-Id: Id4217ed4887e37a74971a35c6a3c931ddeafbbd6 Signed-off-by: Daeyeong Lee --- diff --git a/drivers/soc/samsung/exynos-topology.c b/drivers/soc/samsung/exynos-topology.c index 559511766d85..9e358b3ce4ef 100644 --- a/drivers/soc/samsung/exynos-topology.c +++ b/drivers/soc/samsung/exynos-topology.c @@ -302,10 +302,23 @@ const struct sched_group_energy * const cpu_core_energy(int cpu) } static inline -const struct sched_group_energy * const cpu_cluster_energy(int cpu) +const struct sched_group_energy * const cpu_coregroup_energy(int cpu) { struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL1]; + if (!sge) { + pr_warn("Invalid sched_group_energy for Coregroup%d\n", cpu); + return NULL; + } + + return sge; +} + +static inline +const struct sched_group_energy * const cpu_cluster_energy(int cpu) +{ + struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL2]; + if (!sge) { pr_warn("Invalid sched_group_energy for Cluster%d\n", cpu); return NULL; @@ -317,7 +330,7 @@ const struct sched_group_energy * const cpu_cluster_energy(int cpu) static inline const struct sched_group_energy * const cpu_system_energy(int cpu) { - struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL2]; + struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL3]; if (!sge) { pr_warn("Invalid sched_group_energy for System%d\n", cpu); @@ -331,7 +344,7 @@ static struct sched_domain_topology_level arm64_topology[] = { #ifdef CONFIG_SCHED_MC { cpu_coregroup_mask, core_flags, cpu_core_energy, SD_INIT_NAME(MC) }, #endif - { cpu_cluster_mask, cluster_flags, SD_INIT_NAME(DSU) }, + { cpu_cluster_mask, cluster_flags, cpu_coregroup_energy, SD_INIT_NAME(DSU) }, { cpu_cpu_mask, cpu_flags, cpu_cluster_energy, SD_INIT_NAME(DIE) }, { cpu_cpu_mask, NULL, cpu_system_energy, SD_INIT_NAME(SYS) }, { NULL, }