[COMMON] soc: samsung: topology: Add cpu_coregroup_energy
authorDaeyeong Lee <daeyeong.lee@samsung.com>
Tue, 13 Feb 2018 11:25:25 +0000 (20:25 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:32:54 +0000 (17:32 +0900)
Change-Id: Id4217ed4887e37a74971a35c6a3c931ddeafbbd6
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
drivers/soc/samsung/exynos-topology.c

index 559511766d855020aa37607a54f3cc05f7232173..9e358b3ce4ef097551a5b17bfe7db31210ac0314 100644 (file)
@@ -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, }