}
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;
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);
#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, }