diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-09-03 18:06:02 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-09-03 18:06:02 -0400 |
commit | 7b01463e51f6849d0787b24d06a62efcb243dd44 (patch) | |
tree | c084f9b5290fe4b6f279e711c0ada7be9dca8b32 /drivers/cpuidle | |
parent | a1b5fd8fa29fb2359f398ef17a706449d94de80d (diff) | |
parent | 726fb6b4f2a82a14a906f39bdabac4863b87c01a (diff) |
Merge branch 'pm-sleep'
* pm-sleep:
ACPI / PM: Check low power idle constraints for debug only
PM / s2idle: Rename platform operations structure
PM / s2idle: Rename ->enter_freeze to ->enter_s2idle
PM / s2idle: Rename freeze_state enum and related items
PM / s2idle: Rename PM_SUSPEND_FREEZE to PM_SUSPEND_TO_IDLE
ACPI / PM: Prefer suspend-to-idle over S3 on some systems
platform/x86: intel-hid: Wake up Dell Latitude 7275 from suspend-to-idle
PM / suspend: Define pr_fmt() in suspend.c
PM / suspend: Use mem_sleep_labels[] strings in messages
PM / sleep: Put pm_test under CONFIG_PM_SLEEP_DEBUG
PM / sleep: Check pm_wakeup_pending() in __device_suspend_noirq()
PM / core: Add error argument to dpm_show_time()
PM / core: Split dpm_suspend_noirq() and dpm_resume_noirq()
PM / s2idle: Rearrange the main suspend-to-idle loop
PM / timekeeping: Print debug messages when requested
PM / sleep: Mark suspend/hibernation start and finish
PM / sleep: Do not print debug messages by default
PM / suspend: Export pm_suspend_target_state
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r-- | drivers/cpuidle/cpuidle.c | 18 | ||||
-rw-r--r-- | drivers/cpuidle/dt_idle_states.c | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 60bb64f4329d..484cc8909d5c 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -77,7 +77,7 @@ static int find_deepest_state(struct cpuidle_driver *drv, | |||
77 | struct cpuidle_device *dev, | 77 | struct cpuidle_device *dev, |
78 | unsigned int max_latency, | 78 | unsigned int max_latency, |
79 | unsigned int forbidden_flags, | 79 | unsigned int forbidden_flags, |
80 | bool freeze) | 80 | bool s2idle) |
81 | { | 81 | { |
82 | unsigned int latency_req = 0; | 82 | unsigned int latency_req = 0; |
83 | int i, ret = 0; | 83 | int i, ret = 0; |
@@ -89,7 +89,7 @@ static int find_deepest_state(struct cpuidle_driver *drv, | |||
89 | if (s->disabled || su->disable || s->exit_latency <= latency_req | 89 | if (s->disabled || su->disable || s->exit_latency <= latency_req |
90 | || s->exit_latency > max_latency | 90 | || s->exit_latency > max_latency |
91 | || (s->flags & forbidden_flags) | 91 | || (s->flags & forbidden_flags) |
92 | || (freeze && !s->enter_freeze)) | 92 | || (s2idle && !s->enter_s2idle)) |
93 | continue; | 93 | continue; |
94 | 94 | ||
95 | latency_req = s->exit_latency; | 95 | latency_req = s->exit_latency; |
@@ -128,7 +128,7 @@ int cpuidle_find_deepest_state(struct cpuidle_driver *drv, | |||
128 | } | 128 | } |
129 | 129 | ||
130 | #ifdef CONFIG_SUSPEND | 130 | #ifdef CONFIG_SUSPEND |
131 | static void enter_freeze_proper(struct cpuidle_driver *drv, | 131 | static void enter_s2idle_proper(struct cpuidle_driver *drv, |
132 | struct cpuidle_device *dev, int index) | 132 | struct cpuidle_device *dev, int index) |
133 | { | 133 | { |
134 | /* | 134 | /* |
@@ -143,7 +143,7 @@ static void enter_freeze_proper(struct cpuidle_driver *drv, | |||
143 | * suspended is generally unsafe. | 143 | * suspended is generally unsafe. |
144 | */ | 144 | */ |
145 | stop_critical_timings(); | 145 | stop_critical_timings(); |
146 | drv->states[index].enter_freeze(dev, drv, index); | 146 | drv->states[index].enter_s2idle(dev, drv, index); |
147 | WARN_ON(!irqs_disabled()); | 147 | WARN_ON(!irqs_disabled()); |
148 | /* | 148 | /* |
149 | * timekeeping_resume() that will be called by tick_unfreeze() for the | 149 | * timekeeping_resume() that will be called by tick_unfreeze() for the |
@@ -155,25 +155,25 @@ static void enter_freeze_proper(struct cpuidle_driver *drv, | |||
155 | } | 155 | } |
156 | 156 | ||
157 | /** | 157 | /** |
158 | * cpuidle_enter_freeze - Enter an idle state suitable for suspend-to-idle. | 158 | * cpuidle_enter_s2idle - Enter an idle state suitable for suspend-to-idle. |
159 | * @drv: cpuidle driver for the given CPU. | 159 | * @drv: cpuidle driver for the given CPU. |
160 | * @dev: cpuidle device for the given CPU. | 160 | * @dev: cpuidle device for the given CPU. |
161 | * | 161 | * |
162 | * If there are states with the ->enter_freeze callback, find the deepest of | 162 | * If there are states with the ->enter_s2idle callback, find the deepest of |
163 | * them and enter it with frozen tick. | 163 | * them and enter it with frozen tick. |
164 | */ | 164 | */ |
165 | int cpuidle_enter_freeze(struct cpuidle_driver *drv, struct cpuidle_device *dev) | 165 | int cpuidle_enter_s2idle(struct cpuidle_driver *drv, struct cpuidle_device *dev) |
166 | { | 166 | { |
167 | int index; | 167 | int index; |
168 | 168 | ||
169 | /* | 169 | /* |
170 | * Find the deepest state with ->enter_freeze present, which guarantees | 170 | * Find the deepest state with ->enter_s2idle present, which guarantees |
171 | * that interrupts won't be enabled when it exits and allows the tick to | 171 | * that interrupts won't be enabled when it exits and allows the tick to |
172 | * be frozen safely. | 172 | * be frozen safely. |
173 | */ | 173 | */ |
174 | index = find_deepest_state(drv, dev, UINT_MAX, 0, true); | 174 | index = find_deepest_state(drv, dev, UINT_MAX, 0, true); |
175 | if (index > 0) | 175 | if (index > 0) |
176 | enter_freeze_proper(drv, dev, index); | 176 | enter_s2idle_proper(drv, dev, index); |
177 | 177 | ||
178 | return index; | 178 | return index; |
179 | } | 179 | } |
diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c index bafd4dbf55d4..53342b7f1010 100644 --- a/drivers/cpuidle/dt_idle_states.c +++ b/drivers/cpuidle/dt_idle_states.c | |||
@@ -41,9 +41,9 @@ static int init_state_node(struct cpuidle_state *idle_state, | |||
41 | /* | 41 | /* |
42 | * Since this is not a "coupled" state, it's safe to assume interrupts | 42 | * Since this is not a "coupled" state, it's safe to assume interrupts |
43 | * won't be enabled when it exits allowing the tick to be frozen | 43 | * won't be enabled when it exits allowing the tick to be frozen |
44 | * safely. So enter() can be also enter_freeze() callback. | 44 | * safely. So enter() can be also enter_s2idle() callback. |
45 | */ | 45 | */ |
46 | idle_state->enter_freeze = match_id->data; | 46 | idle_state->enter_s2idle = match_id->data; |
47 | 47 | ||
48 | err = of_property_read_u32(state_node, "wakeup-latency-us", | 48 | err = of_property_read_u32(state_node, "wakeup-latency-us", |
49 | &idle_state->exit_latency); | 49 | &idle_state->exit_latency); |