Merge branch 'bugzilla-13931-sleep-nvs' into release
authorLen Brown <len.brown@intel.com>
Sat, 12 Jun 2010 05:15:40 +0000 (01:15 -0400)
committerLen Brown <len.brown@intel.com>
Sat, 12 Jun 2010 05:15:40 +0000 (01:15 -0400)
Conflicts:
drivers/acpi/sleep.c

Signed-off-by: Len Brown <len.brown@intel.com>
1  2 
drivers/acpi/sleep.c

index 3fb4bdea7e06e59edcd5591897179895ce12807c,403daf0fc8a041d7a8938f2199c72f656989522c..5b7c52e4a00f09001becab5df101e7e5fa4dabc8
@@@ -143,6 -142,8 +145,9 @@@ static void acpi_pm_finish(void
  {
        u32 acpi_state = acpi_target_sleep_state;
  
+       suspend_nvs_free();
++      acpi_ec_unblock_transactions();
        if (acpi_state == ACPI_STATE_S0)
                return;
  
@@@ -272,12 -278,6 +284,11 @@@ static int acpi_suspend_enter(suspend_s
        return ACPI_SUCCESS(status) ? 0 : -EFAULT;
  }
  
-       acpi_ec_unblock_transactions();
 +static void acpi_suspend_finish(void)
 +{
 +      acpi_pm_finish();
 +}
 +
  static int acpi_suspend_state_valid(suspend_state_t pm_state)
  {
        u32 acpi_state;
@@@ -464,14 -457,20 +468,14 @@@ static void acpi_hibernation_leave(void
                panic("ACPI S4 hardware signature mismatch");
        }
        /* Restore the NVS memory area */
-       hibernate_nvs_restore();
+       suspend_nvs_restore();
 +      /* Allow EC transactions to happen. */
 +      acpi_ec_unblock_transactions_early();
  }
  
 -static int acpi_pm_pre_restore(void)
 -{
 -      acpi_disable_all_gpes();
 -      acpi_os_wait_events_complete(NULL);
 -      acpi_ec_suspend_transactions();
 -      return 0;
 -}
 -
 -static void acpi_pm_restore_cleanup(void)
 +static void acpi_pm_thaw(void)
  {
 -      acpi_ec_resume_transactions();
 +      acpi_ec_unblock_transactions();
        acpi_enable_all_runtime_gpes();
  }
  
@@@ -516,9 -515,12 +520,9 @@@ static int acpi_hibernation_begin_old(v
  
  static int acpi_hibernation_pre_snapshot_old(void)
  {
 -      int error = acpi_pm_disable_gpes();
 -
 -      if (!error)
 -              suspend_nvs_save();
 -
 -      return error;
 +      acpi_pm_freeze();
-       hibernate_nvs_save();
++      suspend_nvs_save();
 +      return 0;
  }
  
  /*
@@@ -529,12 -531,12 +533,12 @@@ static struct platform_hibernation_ops 
        .begin = acpi_hibernation_begin_old,
        .end = acpi_pm_end,
        .pre_snapshot = acpi_hibernation_pre_snapshot_old,
-       .finish = acpi_hibernation_finish,
 +      .prepare = acpi_pm_freeze,
+       .finish = acpi_pm_finish,
 -      .prepare = acpi_pm_disable_gpes,
        .enter = acpi_hibernation_enter,
        .leave = acpi_hibernation_leave,
 -      .pre_restore = acpi_pm_pre_restore,
 -      .restore_cleanup = acpi_pm_restore_cleanup,
 +      .pre_restore = acpi_pm_freeze,
 +      .restore_cleanup = acpi_pm_thaw,
        .recover = acpi_pm_finish,
  };
  #endif /* CONFIG_HIBERNATION */