Loading drivers/cpuidle/lpm-levels.c +14 −11 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ static const int num_dbg_elements = 0x100; static void cluster_unprepare(struct lpm_cluster *cluster, const struct cpumask *cpu, int child_idx, bool from_idle, int64_t time); int64_t time, bool success); static void cluster_prepare(struct lpm_cluster *cluster, const struct cpumask *cpu, int child_idx, bool from_idle, int64_t time); Loading Loading @@ -317,7 +317,8 @@ static int lpm_starting_cpu(unsigned int cpu) update_debug_pc_event(CPU_HP_STARTING, cpu, cluster->num_children_in_sync.bits[0], cluster->child_cpus.bits[0], false); cluster_unprepare(cluster, get_cpu_mask(cpu), NR_LPM_LEVELS, false, 0); cluster_unprepare(cluster, get_cpu_mask(cpu), NR_LPM_LEVELS, false, 0, true); return 0; } Loading Loading @@ -1127,7 +1128,7 @@ static void cluster_prepare(struct lpm_cluster *cluster, static void cluster_unprepare(struct lpm_cluster *cluster, const struct cpumask *cpu, int child_idx, bool from_idle, int64_t end_time) int64_t end_time, bool success) { struct lpm_cluster_level *level; bool first_cpu; Loading Loading @@ -1164,13 +1165,13 @@ static void cluster_unprepare(struct lpm_cluster *cluster, if (cluster->stats->sleep_time) cluster->stats->sleep_time = end_time - cluster->stats->sleep_time; lpm_stats_cluster_exit(cluster->stats, cluster->last_level, true); lpm_stats_cluster_exit(cluster->stats, cluster->last_level, success); level = &cluster->levels[cluster->last_level]; if (level->notify_rpm) if (sys_pm_ops && sys_pm_ops->exit) sys_pm_ops->exit(); sys_pm_ops->exit(success); update_debug_pc_event(CLUSTER_EXIT, cluster->last_level, cluster->num_children_in_sync.bits[0], Loading @@ -1186,7 +1187,7 @@ static void cluster_unprepare(struct lpm_cluster *cluster, update_cluster_history(&cluster->history, last_level); cluster_unprepare(cluster->parent, &cluster->child_cpus, last_level, from_idle, end_time); last_level, from_idle, end_time, success); unlock_return: spin_unlock(&cluster->sync_lock); } Loading Loading @@ -1369,7 +1370,7 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev, end_time = ktime_to_ns(ktime_get()); lpm_stats_cpu_exit(idx, end_time, success); cluster_unprepare(cpu->parent, cpumask, idx, true, end_time); cluster_unprepare(cpu->parent, cpumask, idx, true, end_time, success); cpu_unprepare(cpu, idx, true); dev->last_residency = ktime_us_delta(ktime_get(), start); update_history(dev, idx); Loading @@ -1387,6 +1388,7 @@ static void lpm_cpuidle_s2idle(struct cpuidle_device *dev, { struct lpm_cpu *cpu = per_cpu(cpu_lpm, dev->cpu); const struct cpumask *cpumask = get_cpu_mask(dev->cpu); bool success = false; for (; idx >= 0; idx--) { if (lpm_cpu_mode_allow(dev->cpu, idx, false)) Loading @@ -1400,9 +1402,9 @@ static void lpm_cpuidle_s2idle(struct cpuidle_device *dev, cpu_prepare(cpu, idx, true); cluster_prepare(cpu->parent, cpumask, idx, false, 0); psci_enter_sleep(cpu, idx, false); success = psci_enter_sleep(cpu, idx, false); cluster_unprepare(cpu->parent, cpumask, idx, false, 0); cluster_unprepare(cpu->parent, cpumask, idx, false, 0, success); cpu_unprepare(cpu, idx, true); } Loading Loading @@ -1613,6 +1615,7 @@ static int lpm_suspend_enter(suspend_state_t state) struct lpm_cluster *cluster = lpm_cpu->parent; const struct cpumask *cpumask = get_cpu_mask(cpu); int idx; bool success; for (idx = lpm_cpu->nlevels - 1; idx >= 0; idx--) { if (lpm_cpu_mode_allow(cpu, idx, false)) Loading @@ -1625,9 +1628,9 @@ static int lpm_suspend_enter(suspend_state_t state) cpu_prepare(lpm_cpu, idx, false); cluster_prepare(cluster, cpumask, idx, false, 0); psci_enter_sleep(lpm_cpu, idx, false); success = psci_enter_sleep(lpm_cpu, idx, false); cluster_unprepare(cluster, cpumask, idx, false, 0); cluster_unprepare(cluster, cpumask, idx, false, 0, success); cpu_unprepare(lpm_cpu, idx, false); return 0; } Loading drivers/soc/qcom/system_pm.c +3 −2 Original line number Diff line number Diff line Loading @@ -61,8 +61,9 @@ static int system_sleep_enter(struct cpumask *mask) /** * system_sleep_exit() - Activities done when exiting system low power modes */ static void system_sleep_exit(void) static void system_sleep_exit(bool success) { if (success) msm_rpmh_master_stats_update(); } Loading include/soc/qcom/lpm_levels.h +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ struct system_pm_ops { int (*enter)(struct cpumask *mask); void (*exit)(void); void (*exit)(bool success); int (*update_wakeup)(bool b); bool (*sleep_allowed)(void); }; Loading Loading
drivers/cpuidle/lpm-levels.c +14 −11 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ static const int num_dbg_elements = 0x100; static void cluster_unprepare(struct lpm_cluster *cluster, const struct cpumask *cpu, int child_idx, bool from_idle, int64_t time); int64_t time, bool success); static void cluster_prepare(struct lpm_cluster *cluster, const struct cpumask *cpu, int child_idx, bool from_idle, int64_t time); Loading Loading @@ -317,7 +317,8 @@ static int lpm_starting_cpu(unsigned int cpu) update_debug_pc_event(CPU_HP_STARTING, cpu, cluster->num_children_in_sync.bits[0], cluster->child_cpus.bits[0], false); cluster_unprepare(cluster, get_cpu_mask(cpu), NR_LPM_LEVELS, false, 0); cluster_unprepare(cluster, get_cpu_mask(cpu), NR_LPM_LEVELS, false, 0, true); return 0; } Loading Loading @@ -1127,7 +1128,7 @@ static void cluster_prepare(struct lpm_cluster *cluster, static void cluster_unprepare(struct lpm_cluster *cluster, const struct cpumask *cpu, int child_idx, bool from_idle, int64_t end_time) int64_t end_time, bool success) { struct lpm_cluster_level *level; bool first_cpu; Loading Loading @@ -1164,13 +1165,13 @@ static void cluster_unprepare(struct lpm_cluster *cluster, if (cluster->stats->sleep_time) cluster->stats->sleep_time = end_time - cluster->stats->sleep_time; lpm_stats_cluster_exit(cluster->stats, cluster->last_level, true); lpm_stats_cluster_exit(cluster->stats, cluster->last_level, success); level = &cluster->levels[cluster->last_level]; if (level->notify_rpm) if (sys_pm_ops && sys_pm_ops->exit) sys_pm_ops->exit(); sys_pm_ops->exit(success); update_debug_pc_event(CLUSTER_EXIT, cluster->last_level, cluster->num_children_in_sync.bits[0], Loading @@ -1186,7 +1187,7 @@ static void cluster_unprepare(struct lpm_cluster *cluster, update_cluster_history(&cluster->history, last_level); cluster_unprepare(cluster->parent, &cluster->child_cpus, last_level, from_idle, end_time); last_level, from_idle, end_time, success); unlock_return: spin_unlock(&cluster->sync_lock); } Loading Loading @@ -1369,7 +1370,7 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev, end_time = ktime_to_ns(ktime_get()); lpm_stats_cpu_exit(idx, end_time, success); cluster_unprepare(cpu->parent, cpumask, idx, true, end_time); cluster_unprepare(cpu->parent, cpumask, idx, true, end_time, success); cpu_unprepare(cpu, idx, true); dev->last_residency = ktime_us_delta(ktime_get(), start); update_history(dev, idx); Loading @@ -1387,6 +1388,7 @@ static void lpm_cpuidle_s2idle(struct cpuidle_device *dev, { struct lpm_cpu *cpu = per_cpu(cpu_lpm, dev->cpu); const struct cpumask *cpumask = get_cpu_mask(dev->cpu); bool success = false; for (; idx >= 0; idx--) { if (lpm_cpu_mode_allow(dev->cpu, idx, false)) Loading @@ -1400,9 +1402,9 @@ static void lpm_cpuidle_s2idle(struct cpuidle_device *dev, cpu_prepare(cpu, idx, true); cluster_prepare(cpu->parent, cpumask, idx, false, 0); psci_enter_sleep(cpu, idx, false); success = psci_enter_sleep(cpu, idx, false); cluster_unprepare(cpu->parent, cpumask, idx, false, 0); cluster_unprepare(cpu->parent, cpumask, idx, false, 0, success); cpu_unprepare(cpu, idx, true); } Loading Loading @@ -1613,6 +1615,7 @@ static int lpm_suspend_enter(suspend_state_t state) struct lpm_cluster *cluster = lpm_cpu->parent; const struct cpumask *cpumask = get_cpu_mask(cpu); int idx; bool success; for (idx = lpm_cpu->nlevels - 1; idx >= 0; idx--) { if (lpm_cpu_mode_allow(cpu, idx, false)) Loading @@ -1625,9 +1628,9 @@ static int lpm_suspend_enter(suspend_state_t state) cpu_prepare(lpm_cpu, idx, false); cluster_prepare(cluster, cpumask, idx, false, 0); psci_enter_sleep(lpm_cpu, idx, false); success = psci_enter_sleep(lpm_cpu, idx, false); cluster_unprepare(cluster, cpumask, idx, false, 0); cluster_unprepare(cluster, cpumask, idx, false, 0, success); cpu_unprepare(lpm_cpu, idx, false); return 0; } Loading
drivers/soc/qcom/system_pm.c +3 −2 Original line number Diff line number Diff line Loading @@ -61,8 +61,9 @@ static int system_sleep_enter(struct cpumask *mask) /** * system_sleep_exit() - Activities done when exiting system low power modes */ static void system_sleep_exit(void) static void system_sleep_exit(bool success) { if (success) msm_rpmh_master_stats_update(); } Loading
include/soc/qcom/lpm_levels.h +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ struct system_pm_ops { int (*enter)(struct cpumask *mask); void (*exit)(void); void (*exit)(bool success); int (*update_wakeup)(bool b); bool (*sleep_allowed)(void); }; Loading