Commit 87186475 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM: Fix warning in pm_restrict_gfp_mask() during SNAPSHOT_S2RAM ioctl

A warning is printed by pm_restrict_gfp_mask() while the
SNAPSHOT_S2RAM ioctl is being executed after creating a hibernation
image, because pm_restrict_gfp_mask() has been called once already
before the image creation and suspend_devices_and_enter() calls it
once again.  This happens after commit 452aa699
(mm/pm: force GFP_NOIO during suspend/hibernation and resume).

To avoid this issue, move pm_restrict_gfp_mask() and
pm_restore_gfp_mask() from suspend_devices_and_enter() to its caller
in kernel/power/suspend.c.
Reported-by: default avatarAlexandre Felipe Muller de Souza <alexandrefm@mandriva.com.br>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Cc: stable@kernel.org
parent 54b33352
...@@ -216,7 +216,6 @@ int suspend_devices_and_enter(suspend_state_t state) ...@@ -216,7 +216,6 @@ int suspend_devices_and_enter(suspend_state_t state)
goto Close; goto Close;
} }
suspend_console(); suspend_console();
pm_restrict_gfp_mask();
suspend_test_start(); suspend_test_start();
error = dpm_suspend_start(PMSG_SUSPEND); error = dpm_suspend_start(PMSG_SUSPEND);
if (error) { if (error) {
...@@ -233,7 +232,6 @@ int suspend_devices_and_enter(suspend_state_t state) ...@@ -233,7 +232,6 @@ int suspend_devices_and_enter(suspend_state_t state)
suspend_test_start(); suspend_test_start();
dpm_resume_end(PMSG_RESUME); dpm_resume_end(PMSG_RESUME);
suspend_test_finish("resume devices"); suspend_test_finish("resume devices");
pm_restore_gfp_mask();
resume_console(); resume_console();
Close: Close:
if (suspend_ops->end) if (suspend_ops->end)
...@@ -294,7 +292,9 @@ int enter_state(suspend_state_t state) ...@@ -294,7 +292,9 @@ int enter_state(suspend_state_t state)
goto Finish; goto Finish;
pr_debug("PM: Entering %s sleep\n", pm_states[state]); pr_debug("PM: Entering %s sleep\n", pm_states[state]);
pm_restrict_gfp_mask();
error = suspend_devices_and_enter(state); error = suspend_devices_and_enter(state);
pm_restore_gfp_mask();
Finish: Finish:
pr_debug("PM: Finishing wakeup.\n"); pr_debug("PM: Finishing wakeup.\n");
......
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