summaryrefslogtreecommitdiff
path: root/drivers/cpuidle
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/cpuidle-dbx500.c13
-rw-r--r--drivers/cpuidle/cpuidle-dbx500_dbg.c25
-rw-r--r--drivers/cpuidle/cpuidle-dbx500_dbg.h16
3 files changed, 39 insertions, 15 deletions
diff --git a/drivers/cpuidle/cpuidle-dbx500.c b/drivers/cpuidle/cpuidle-dbx500.c
index 59f74a1b98f..aeb56f97611 100644
--- a/drivers/cpuidle/cpuidle-dbx500.c
+++ b/drivers/cpuidle/cpuidle-dbx500.c
@@ -288,7 +288,7 @@ static int determine_sleep_state(u32 *sleep_time)
int cpu;
int max_depth;
- bool power_state_req;
+ bool uart, modem, ape;
/* If first cpu to sleep, go to most shallow sleep state */
if (!is_last_cpu_running())
@@ -306,8 +306,6 @@ static int determine_sleep_state(u32 *sleep_time)
return CI_WFI;
}
- power_state_req = power_state_active_is_enabled() ||
- prcmu_is_ac_wake_requested();
(*sleep_time) = get_remaining_sleep_time(NULL, NULL);
@@ -324,6 +322,10 @@ static int determine_sleep_state(u32 *sleep_time)
max_depth = per_cpu(cpu_state, cpu)->gov_cstate;
}
+ uart = ux500_ci_dbg_force_ape_on();
+ ape = power_state_active_is_enabled();
+ modem = prcmu_is_ac_wake_requested();
+
for (i = max_depth; i > 0; i--) {
if ((*sleep_time) <= cstates[i].threshold)
@@ -331,8 +333,7 @@ static int determine_sleep_state(u32 *sleep_time)
if (cstates[i].APE == APE_OFF) {
/* This state says APE should be off */
- if (power_state_req ||
- ux500_ci_dbg_force_ape_on())
+ if (ape || modem || uart)
continue;
}
@@ -340,7 +341,7 @@ static int determine_sleep_state(u32 *sleep_time)
break;
}
- ux500_ci_dbg_register_reason(i, power_state_req,
+ ux500_ci_dbg_register_reason(i, ape, modem, uart,
(*sleep_time),
max_depth);
return max(CI_WFI, i);
diff --git a/drivers/cpuidle/cpuidle-dbx500_dbg.c b/drivers/cpuidle/cpuidle-dbx500_dbg.c
index 43cdcfdd241..16a8f66a40c 100644
--- a/drivers/cpuidle/cpuidle-dbx500_dbg.c
+++ b/drivers/cpuidle/cpuidle-dbx500_dbg.c
@@ -64,6 +64,8 @@ struct state_history {
u32 exit_counter;
ktime_t measure_begin;
int ape_blocked;
+ int uart_blocked;
+ int modem_blocked;
int time_blocked;
int both_blocked;
int gov_blocked;
@@ -86,6 +88,8 @@ static int verbose;
static bool apidle_both_blocked;
static bool apidle_ape_blocked;
+static bool apidle_modem_blocked;
+static bool apidle_uart_blocked;
static bool apidle_time_blocked;
static bool apidle_gov_blocked;
@@ -336,13 +340,15 @@ static void state_record_time(struct state_history *sh, int ctarget,
sh->states[sh->state].counter++;
}
-void ux500_ci_dbg_register_reason(int idx, bool power_state_req,
+void ux500_ci_dbg_register_reason(int idx, bool ape, bool modem, bool uart,
u32 time, u32 max_depth)
{
if (cstates[idx].state == CI_IDLE && verbose) {
- apidle_ape_blocked = power_state_req;
+ apidle_ape_blocked = ape;
+ apidle_uart_blocked = uart;
+ apidle_modem_blocked = modem;
apidle_time_blocked = time < cstates[idx + 1].threshold;
- apidle_both_blocked = power_state_req && apidle_time_blocked;
+ apidle_both_blocked = (ape || uart || modem) && apidle_time_blocked;
apidle_gov_blocked = cstates[max_depth].state == CI_IDLE;
}
}
@@ -369,6 +375,10 @@ void ux500_ci_dbg_log(int ctarget, ktime_t enter_time)
sh->both_blocked++;
if (apidle_ape_blocked)
sh->ape_blocked++;
+ if (apidle_uart_blocked)
+ sh->uart_blocked++;
+ if (apidle_modem_blocked)
+ sh->modem_blocked++;
if (apidle_time_blocked)
sh->time_blocked++;
if (apidle_gov_blocked)
@@ -457,6 +467,8 @@ static void state_history_reset(void)
sh->exit_counter = 0;
sh->ape_blocked = 0;
+ sh->uart_blocked = 0;
+ sh->modem_blocked = 0;
sh->time_blocked = 0;
sh->both_blocked = 0;
sh->gov_blocked = 0;
@@ -605,8 +617,11 @@ static void stats_disp_one(struct seq_file *s, struct state_history *sh,
(u32) t_us, (u32)perc);
if (cstates[i].state == CI_IDLE && verbose)
- seq_printf(s, ", reg:%d time:%d both:%d gov:%d",
- sh->ape_blocked, sh->time_blocked,
+ seq_printf(s,
+ ", reg:%d modem: %d uart: %d time:%d both:%d gov:%d",
+ sh->ape_blocked,
+ sh->modem_blocked, sh->uart_blocked,
+ sh->time_blocked,
sh->both_blocked, sh->gov_blocked);
if (sh->states[i].counter && verbose)
diff --git a/drivers/cpuidle/cpuidle-dbx500_dbg.h b/drivers/cpuidle/cpuidle-dbx500_dbg.h
index b8089c478a1..99a23984769 100644
--- a/drivers/cpuidle/cpuidle-dbx500_dbg.h
+++ b/drivers/cpuidle/cpuidle-dbx500_dbg.h
@@ -18,8 +18,12 @@ void ux500_ci_dbg_wake_latency(int ctarget, int sleep_time);
void ux500_ci_dbg_exit_latency(int ctarget, ktime_t now, ktime_t exit,
ktime_t enter);
-void ux500_ci_dbg_register_reason(int idx, bool power_state_req,
- u32 sleep_time, u32 max_depth);
+void ux500_ci_dbg_register_reason(int idx,
+ bool ape,
+ bool modem,
+ bool uart,
+ u32 sleep_time,
+ u32 max_depth);
bool ux500_ci_dbg_force_ape_on(void);
int ux500_ci_dbg_deepest_state(void);
@@ -43,8 +47,12 @@ static inline void ux500_ci_dbg_exit_latency(int ctarget,
static inline void ux500_ci_dbg_wake_latency(int ctarget, int sleep_time) { }
-static inline void ux500_ci_dbg_register_reason(int idx, bool power_state_req,
- u32 sleep_time, u32 max_depth) { }
+static inline void ux500_ci_dbg_register_reason(int idx,
+ bool ape,
+ bool modem,
+ bool uart,
+ u32 sleep_time,
+ u32 max_depth) { }
static inline bool ux500_ci_dbg_force_ape_on(void)
{