Loading drivers/cpuidle/lpm-levels.c +18 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ #define SCLK_HZ (32768) #define PSCI_POWER_STATE(reset) (reset << 30) #define PSCI_AFFINITY_LEVEL(lvl) ((lvl & 0x3) << 24) #define BIAS_HYST (5 * NSEC_PER_MSEC) enum { MSM_LPM_LVL_DBG_SUSPEND_LIMITS = BIT(0), Loading Loading @@ -572,6 +573,17 @@ static void clear_predict_history(void) static void update_history(struct cpuidle_device *dev, int idx); static inline bool is_cpu_biased(int cpu) { u64 now = sched_clock(); u64 last = sched_get_cpu_last_busy_time(cpu); if (!last) return false; return (now - last) < BIAS_HYST; } static int cpu_power_select(struct cpuidle_device *dev, struct lpm_cpu *cpu) { Loading @@ -596,6 +608,11 @@ static int cpu_power_select(struct cpuidle_device *dev, next_event_us = (uint32_t)(ktime_to_us(get_next_event_time(dev->cpu))); if (is_cpu_biased(dev->cpu)) { best_level = 0; goto done_select; } for (i = 0; i < cpu->nlevels; i++) { struct lpm_cpu_level *level = &cpu->levels[i]; struct power_params *pwr_params = &level->pwr; Loading Loading @@ -674,6 +691,7 @@ static int cpu_power_select(struct cpuidle_device *dev, histtimer_start(htime); } done_select: trace_cpu_power_select(best_level, sleep_us, latency_us, next_event_us); trace_cpu_pred_select(idx_restrict_time ? 2 : (predicted ? 1 : 0), Loading Loading
drivers/cpuidle/lpm-levels.c +18 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ #define SCLK_HZ (32768) #define PSCI_POWER_STATE(reset) (reset << 30) #define PSCI_AFFINITY_LEVEL(lvl) ((lvl & 0x3) << 24) #define BIAS_HYST (5 * NSEC_PER_MSEC) enum { MSM_LPM_LVL_DBG_SUSPEND_LIMITS = BIT(0), Loading Loading @@ -572,6 +573,17 @@ static void clear_predict_history(void) static void update_history(struct cpuidle_device *dev, int idx); static inline bool is_cpu_biased(int cpu) { u64 now = sched_clock(); u64 last = sched_get_cpu_last_busy_time(cpu); if (!last) return false; return (now - last) < BIAS_HYST; } static int cpu_power_select(struct cpuidle_device *dev, struct lpm_cpu *cpu) { Loading @@ -596,6 +608,11 @@ static int cpu_power_select(struct cpuidle_device *dev, next_event_us = (uint32_t)(ktime_to_us(get_next_event_time(dev->cpu))); if (is_cpu_biased(dev->cpu)) { best_level = 0; goto done_select; } for (i = 0; i < cpu->nlevels; i++) { struct lpm_cpu_level *level = &cpu->levels[i]; struct power_params *pwr_params = &level->pwr; Loading Loading @@ -674,6 +691,7 @@ static int cpu_power_select(struct cpuidle_device *dev, histtimer_start(htime); } done_select: trace_cpu_power_select(best_level, sleep_us, latency_us, next_event_us); trace_cpu_pred_select(idx_restrict_time ? 2 : (predicted ? 1 : 0), Loading