Loading drivers/cpuidle/lpm-levels-of.c +20 −4 Original line number Diff line number Diff line Loading @@ -80,6 +80,14 @@ static void set_optimum_cpu_residency(struct lpm_cpu *cpu, int cpu_id, for (i = 0; i < cpu->nlevels; i++) { struct power_params *pwr = &cpu->levels[i].pwr; mode_avail = probe_time || lpm_cpu_mode_allow(cpu_id, i, true); if (!mode_avail) { residency[i] = 0; continue; } residency[i] = ~0; for (j = i + 1; j < cpu->nlevels; j++) { mode_avail = probe_time || Loading @@ -102,12 +110,20 @@ static void set_optimum_cluster_residency(struct lpm_cluster *cluster, for (i = 0; i < cluster->nlevels; i++) { struct power_params *pwr = &cluster->levels[i].pwr; pwr->max_residency = ~0; for (j = 0; j < cluster->nlevels; j++) { if (i >= j) mode_avail = probe_time || lpm_cluster_mode_allow(cluster, i, true); if (!mode_avail) { pwr->max_residency = 0; continue; } pwr->max_residency = ~0; for (j = i+1; j < cluster->nlevels; j++) { mode_avail = probe_time || lpm_cluster_mode_allow(cluster, j, true); if (mode_avail && (pwr->max_residency > pwr->residencies[j]) && (pwr->residencies[j] != 0)) Loading drivers/cpuidle/lpm-levels.c +15 −14 Original line number Diff line number Diff line Loading @@ -480,24 +480,25 @@ static int cpu_power_select(struct cpuidle_device *dev, if (next_event_us) { if (next_event_us < lvl_latency_us) continue; break; if (((next_event_us - lvl_latency_us) < sleep_us) || (next_event_us < sleep_us)) next_wakeup_us = next_event_us - lvl_latency_us; } if (next_wakeup_us <= residency[i]) { best_level = i; if (next_event_us && next_event_us < sleep_us && (mode != MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)) modified_time_us = next_event_us - lvl_latency_us; else modified_time_us = 0; if (next_wakeup_us <= residency[i]) break; } } if (modified_time_us) msm_pm_set_timer(modified_time_us); Loading Loading @@ -593,10 +594,10 @@ static int cluster_select(struct lpm_cluster *cluster, bool from_idle) continue; if (from_idle && latency_us < pwr_params->latency_us) continue; break; if (sleep_us < pwr_params->time_overhead_us) continue; break; if (suspend_in_progress && from_idle && level->notify_rpm) continue; Loading @@ -604,11 +605,11 @@ static int cluster_select(struct lpm_cluster *cluster, bool from_idle) if (level->notify_rpm && msm_rpm_waiting_for_ack()) continue; if (sleep_us <= pwr_params->max_residency) { best_level = i; if (sleep_us <= pwr_params->max_residency) break; } } return best_level; } Loading Loading
drivers/cpuidle/lpm-levels-of.c +20 −4 Original line number Diff line number Diff line Loading @@ -80,6 +80,14 @@ static void set_optimum_cpu_residency(struct lpm_cpu *cpu, int cpu_id, for (i = 0; i < cpu->nlevels; i++) { struct power_params *pwr = &cpu->levels[i].pwr; mode_avail = probe_time || lpm_cpu_mode_allow(cpu_id, i, true); if (!mode_avail) { residency[i] = 0; continue; } residency[i] = ~0; for (j = i + 1; j < cpu->nlevels; j++) { mode_avail = probe_time || Loading @@ -102,12 +110,20 @@ static void set_optimum_cluster_residency(struct lpm_cluster *cluster, for (i = 0; i < cluster->nlevels; i++) { struct power_params *pwr = &cluster->levels[i].pwr; pwr->max_residency = ~0; for (j = 0; j < cluster->nlevels; j++) { if (i >= j) mode_avail = probe_time || lpm_cluster_mode_allow(cluster, i, true); if (!mode_avail) { pwr->max_residency = 0; continue; } pwr->max_residency = ~0; for (j = i+1; j < cluster->nlevels; j++) { mode_avail = probe_time || lpm_cluster_mode_allow(cluster, j, true); if (mode_avail && (pwr->max_residency > pwr->residencies[j]) && (pwr->residencies[j] != 0)) Loading
drivers/cpuidle/lpm-levels.c +15 −14 Original line number Diff line number Diff line Loading @@ -480,24 +480,25 @@ static int cpu_power_select(struct cpuidle_device *dev, if (next_event_us) { if (next_event_us < lvl_latency_us) continue; break; if (((next_event_us - lvl_latency_us) < sleep_us) || (next_event_us < sleep_us)) next_wakeup_us = next_event_us - lvl_latency_us; } if (next_wakeup_us <= residency[i]) { best_level = i; if (next_event_us && next_event_us < sleep_us && (mode != MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)) modified_time_us = next_event_us - lvl_latency_us; else modified_time_us = 0; if (next_wakeup_us <= residency[i]) break; } } if (modified_time_us) msm_pm_set_timer(modified_time_us); Loading Loading @@ -593,10 +594,10 @@ static int cluster_select(struct lpm_cluster *cluster, bool from_idle) continue; if (from_idle && latency_us < pwr_params->latency_us) continue; break; if (sleep_us < pwr_params->time_overhead_us) continue; break; if (suspend_in_progress && from_idle && level->notify_rpm) continue; Loading @@ -604,11 +605,11 @@ static int cluster_select(struct lpm_cluster *cluster, bool from_idle) if (level->notify_rpm && msm_rpm_waiting_for_ack()) continue; if (sleep_us <= pwr_params->max_residency) { best_level = i; if (sleep_us <= pwr_params->max_residency) break; } } return best_level; } Loading