Re: [PATCH 2/2] Fix console handling during suspend/resume

Pavel Machek
2006-06-14T10:34:04Z

Hi!

> The old code was terminally broken, and would do extremely bad things if
> you used netconsole, for example. Like sending out packets when the device
> had already been suspended etc.
>
> The new version may not be perfect either, but it seems fundamentally like
> a better design: we just hold on to the primary console semaphore over the
> whole suspend event, forcing printk() to just buffer up its data until we
> can show it again. The code is also much simpler and more obvious.

Okay, but we probably do not want to be in SYSTEM_BOOTING state,
right?

> - orig_kmsg = kmsg_redirect;
> - kmsg_redirect = SUSPEND_CONSOLE;
> + console_suspended = 1;
> + system_state = SYSTEM_BOOTING;
> return 0;
> }
>
> void pm_restore_console(void)
> {
> - acquire_console_sem();
> - set_console(orig_fgconsole);
> + console_suspended = 0;
> + system_state = SYSTEM_BOOTING;

And we definitely want to go back to SYSTEM_RUNNING or how is it
called here.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html