@@ -89,7 +89,8 @@ static int find_deepest_state(struct cpuidle_driver *drv,
s->exit_latency_ns <= latency_req ||
s->exit_latency_ns > max_latency_ns ||
(s->flags & forbidden_flags) ||
- (s2idle && !s->enter_s2idle))
+ (s2idle && !s->enter_s2idle) ||
+ (!s2idle && (s->flags & CPUIDLE_FLAG_S2ILDE)))
continue;
latency_req = s->exit_latency_ns;
@@ -80,6 +80,9 @@ static int init_state_node(struct cpuidle_state *idle_state,
idle_state->flags = 0;
if (of_property_read_bool(state_node, "local-timer-stop"))
idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP;
+
+ if (of_property_read_bool(state_node, "for-s2idle-only"))
+ idle_state->flags |= CPUIDLE_FLAG_S2ILDE;
/*
* TODO:
* replace with kstrdup and pointer assignment when name
@@ -78,6 +78,7 @@ struct cpuidle_state {
#define CPUIDLE_FLAG_TIMER_STOP BIT(2) /* timer is stopped on this state */
#define CPUIDLE_FLAG_UNUSABLE BIT(3) /* avoid using this state */
#define CPUIDLE_FLAG_OFF BIT(4) /* disable this state by default */
+#define CPUIDLE_FLAG_S2ILDE BIT(5) /* state is used for s2idle only */
struct cpuidle_device_kobj;
struct cpuidle_state_kobj;