Commit 8d89835b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM: suspend: Do not pause cpuidle in the suspend-to-idle path

It is pointless to pause cpuidle in the suspend-to-idle path,
because it is going to be resumed in the same path later and
pausing it does not serve any particular purpose in that case.

Rework the code to avoid doing that.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Tested-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 928265e3
...@@ -747,8 +747,6 @@ void dpm_resume_noirq(pm_message_t state) ...@@ -747,8 +747,6 @@ void dpm_resume_noirq(pm_message_t state)
resume_device_irqs(); resume_device_irqs();
device_wakeup_disarm_wake_irqs(); device_wakeup_disarm_wake_irqs();
cpuidle_resume();
} }
/** /**
...@@ -881,6 +879,7 @@ void dpm_resume_early(pm_message_t state) ...@@ -881,6 +879,7 @@ void dpm_resume_early(pm_message_t state)
void dpm_resume_start(pm_message_t state) void dpm_resume_start(pm_message_t state)
{ {
dpm_resume_noirq(state); dpm_resume_noirq(state);
cpuidle_resume();
dpm_resume_early(state); dpm_resume_early(state);
} }
EXPORT_SYMBOL_GPL(dpm_resume_start); EXPORT_SYMBOL_GPL(dpm_resume_start);
...@@ -1337,8 +1336,6 @@ int dpm_suspend_noirq(pm_message_t state) ...@@ -1337,8 +1336,6 @@ int dpm_suspend_noirq(pm_message_t state)
{ {
int ret; int ret;
cpuidle_pause();
device_wakeup_arm_wake_irqs(); device_wakeup_arm_wake_irqs();
suspend_device_irqs(); suspend_device_irqs();
...@@ -1522,9 +1519,13 @@ int dpm_suspend_end(pm_message_t state) ...@@ -1522,9 +1519,13 @@ int dpm_suspend_end(pm_message_t state)
if (error) if (error)
goto out; goto out;
cpuidle_pause();
error = dpm_suspend_noirq(state); error = dpm_suspend_noirq(state);
if (error) if (error) {
cpuidle_resume();
dpm_resume_early(resume_event(state)); dpm_resume_early(resume_event(state));
}
out: out:
dpm_show_time(starttime, state, error, "end"); dpm_show_time(starttime, state, error, "end");
......
...@@ -97,7 +97,6 @@ static void s2idle_enter(void) ...@@ -97,7 +97,6 @@ static void s2idle_enter(void)
raw_spin_unlock_irq(&s2idle_lock); raw_spin_unlock_irq(&s2idle_lock);
cpus_read_lock(); cpus_read_lock();
cpuidle_resume();
/* Push all the CPUs into the idle loop. */ /* Push all the CPUs into the idle loop. */
wake_up_all_idle_cpus(); wake_up_all_idle_cpus();
...@@ -105,7 +104,6 @@ static void s2idle_enter(void) ...@@ -105,7 +104,6 @@ static void s2idle_enter(void)
swait_event_exclusive(s2idle_wait_head, swait_event_exclusive(s2idle_wait_head,
s2idle_state == S2IDLE_STATE_WAKE); s2idle_state == S2IDLE_STATE_WAKE);
cpuidle_pause();
cpus_read_unlock(); cpus_read_unlock();
raw_spin_lock_irq(&s2idle_lock); raw_spin_lock_irq(&s2idle_lock);
...@@ -405,6 +403,9 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) ...@@ -405,6 +403,9 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
if (error) if (error)
goto Devices_early_resume; goto Devices_early_resume;
if (state != PM_SUSPEND_TO_IDLE)
cpuidle_pause();
error = dpm_suspend_noirq(PMSG_SUSPEND); error = dpm_suspend_noirq(PMSG_SUSPEND);
if (error) { if (error) {
pr_err("noirq suspend of devices failed\n"); pr_err("noirq suspend of devices failed\n");
...@@ -459,6 +460,9 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) ...@@ -459,6 +460,9 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
dpm_resume_noirq(PMSG_RESUME); dpm_resume_noirq(PMSG_RESUME);
Platform_early_resume: Platform_early_resume:
if (state != PM_SUSPEND_TO_IDLE)
cpuidle_resume();
platform_resume_early(state); platform_resume_early(state);
Devices_early_resume: Devices_early_resume:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment