PM: Wait for console in resume
authorArve Hjønnevåg <arve@android.com>
Sat, 14 Feb 2009 01:06:17 +0000 (02:06 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 Feb 2009 22:17:17 +0000 (14:17 -0800)
Avoids later waking up to a blinking cursor if the device woke up and
returned to sleep before the console switch happened.

Signed-off-by: Brian Swetland <swetland@google.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Len Brown <lenb@kernel.org>
Cc: Greg KH <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/power/console.c

index b8628be..a3961b2 100644 (file)
@@ -78,6 +78,12 @@ void pm_restore_console(void)
        }
        set_console(orig_fgconsole);
        release_console_sem();
        }
        set_console(orig_fgconsole);
        release_console_sem();
+
+       if (vt_waitactive(orig_fgconsole)) {
+               pr_debug("Resume: Can't switch VCs.");
+               return;
+       }
+
        kmsg_redirect = orig_kmsg;
 }
 #endif
        kmsg_redirect = orig_kmsg;
 }
 #endif