Skip to content

Commit 8eb0fd3

Browse files
committed
PM: sleep: Integrate suspend-to-idle with generig suspend flow
After previous changes the suspend-to-idle code flow can be integrated more tightly with the generic system suspend code flow by making suspend_enter() call s2idle_loop() later and removing the direct invocations of dpm_noirq_begin(), dpm_noirq_suspend_devices(), dpm_noirq_end(), and dpm_noirq_resume_devices() from the latter, so do that. This change is not expected to alter functionality. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 56b9918 commit 8eb0fd3

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

kernel/power/suspend.c

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,6 @@ static void s2idle_enter(void)
119119

120120
static void s2idle_loop(void)
121121
{
122-
int error;
123-
124-
dpm_noirq_begin();
125-
error = dpm_noirq_suspend_devices(PMSG_SUSPEND);
126-
if (error)
127-
goto resume;
128-
129122
pm_pr_dbg("suspend-to-idle\n");
130123

131124
/*
@@ -150,10 +143,6 @@ static void s2idle_loop(void)
150143
}
151144

152145
pm_pr_dbg("resume from suspend-to-idle\n");
153-
154-
resume:
155-
dpm_noirq_resume_devices(PMSG_RESUME);
156-
dpm_noirq_end();
157146
}
158147

159148
void s2idle_wake(void)
@@ -408,11 +397,6 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
408397
if (error)
409398
goto Devices_early_resume;
410399

411-
if (state == PM_SUSPEND_TO_IDLE && pm_test_level != TEST_PLATFORM) {
412-
s2idle_loop();
413-
goto Platform_early_resume;
414-
}
415-
416400
error = dpm_suspend_noirq(PMSG_SUSPEND);
417401
if (error) {
418402
pr_err("noirq suspend of devices failed\n");
@@ -425,6 +409,11 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
425409
if (suspend_test(TEST_PLATFORM))
426410
goto Platform_wake;
427411

412+
if (state == PM_SUSPEND_TO_IDLE) {
413+
s2idle_loop();
414+
goto Platform_wake;
415+
}
416+
428417
error = suspend_disable_secondary_cpus();
429418
if (error || suspend_test(TEST_CPUS))
430419
goto Enable_cpus;

0 commit comments

Comments
 (0)