ACPI / PM: Call suspend_nvs_free() earlier during resume
authorRafael J. Wysocki <rjw@sisk.pl>
Wed, 19 Jan 2011 21:27:55 +0000 (22:27 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Jan 2011 02:30:17 +0000 (18:30 -0800)
It turns out that some device drivers map pages from the ACPI NVS region
during resume using ioremap(), which conflicts with ioremap_cache() used
for mapping those pages by the NVS save/restore code in nvs.c.

Make the NVS pages mapped by the code in nvs.c be unmapped before device
drivers' resume routines run.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/acpi/sleep.c

index fdd3aeeb6defd06e1103a368e9bfd79bf837b364..d6a8cd14de2e824ddb15563aa625fa1d5236ea5a 100644 (file)
@@ -166,6 +166,7 @@ static void acpi_pm_finish(void)
        u32 acpi_state = acpi_target_sleep_state;
 
        acpi_ec_unblock_transactions();
+       suspend_nvs_free();
 
        if (acpi_state == ACPI_STATE_S0)
                return;
@@ -186,7 +187,6 @@ static void acpi_pm_finish(void)
  */
 static void acpi_pm_end(void)
 {
-       suspend_nvs_free();
        /*
         * This is necessary in case acpi_pm_finish() is not called during a
         * failing transition to a sleep state.