PM: Wait for console in resume

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>

authored by Arve Hjønnevåg and committed by Linus Torvalds b090f9fa ebae2604

+6
+6
kernel/power/console.c
··· 78 78 } 79 79 set_console(orig_fgconsole); 80 80 release_console_sem(); 81 + 82 + if (vt_waitactive(orig_fgconsole)) { 83 + pr_debug("Resume: Can't switch VCs."); 84 + return; 85 + } 86 + 81 87 kmsg_redirect = orig_kmsg; 82 88 } 83 89 #endif