OMAP3: PM: Fix wrong sequence in suspend.
authorJouni Hogander <jouni.hogander@nokia.com>
Wed, 29 Oct 2008 10:06:04 +0000 (12:06 +0200)
committerKevin Hilman <khilman@deeprootsystems.com>
Wed, 5 Aug 2009 16:10:54 +0000 (09:10 -0700)
Powerdomain previous state is checked after restoring new states in
suspend. This patch fixes this problem.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-omap2/pm34xx.c

index b07efb26de18dfd870a71e7afc74fb7e6e69162b..488d595d8e4b337a29a589a950a5d3f73aca15a4 100644 (file)
@@ -326,7 +326,6 @@ static int omap3_pm_suspend(void)
 restore:
        /* Restore next_pwrsts */
        list_for_each_entry(pwrst, &pwrst_list, node) {
-               set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state);
                state = pwrdm_read_prev_pwrst(pwrst->pwrdm);
                if (state > pwrst->next_state) {
                        printk(KERN_INFO "Powerdomain (%s) didn't enter "
@@ -334,6 +333,7 @@ restore:
                               pwrst->pwrdm->name, pwrst->next_state);
                        ret = -1;
                }
+               set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state);
        }
        if (ret)
                printk(KERN_ERR "Could not enter target state in pm_suspend\n");