[linux-pm] [PATCH 2/2] Fix console handling during suspend/resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux