]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
add support for console resuming, implement it for uart, use on x86
authoravg <avg@FreeBSD.org>
Tue, 29 May 2018 16:16:24 +0000 (16:16 +0000)
committeravg <avg@FreeBSD.org>
Tue, 29 May 2018 16:16:24 +0000 (16:16 +0000)
commitdb453a7a34bbcb1e6b588c6ba089502eeb44549d
tree7b1cf67a643f8cef8c74f85dc6a05351b36325ee
parent334106354e092381f199e232c299aaad5332125c
add support for console resuming, implement it for uart, use on x86

This change adds a new optional console method cn_resume and a kernel
console interface cnresume.  Consoles that may need to re-initialize
their hardware after suspend (e.g., because firmware does not care to do
it) will implement cn_resume.  Note that it is called in rather early
environment not unlike early boot, so the same restrictions apply.
Platform specific code, for platforms that support hardware suspend,
should call cnresume early after resume, before any console output is
expected.

This change fixes a problem with a system of mine failing to resume when
a serial console is used.  I found that the serial port was in a strange
configuration and an attempt to write to it likely resulted in an
infinite loop.

To avoid adding cn_resume method to every console driver, CONSOLE_DRIVER
macro has been extended to support optional methods.

Reviewed by: imp, mav
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15552
sys/dev/uart/uart_tty.c
sys/kern/kern_cons.c
sys/sys/cons.h
sys/x86/acpica/acpi_wakeup.c