From dd7980e6d9ffeaac4ae440e6d2f9e8aa88e7ebc7 Mon Sep 17 00:00:00 2001 From: Russell Currey Date: Fri, 23 Oct 2015 16:15:26 +1100 Subject: console: Completely flush output buffer before power down and reboot Completely flush the output buffer of the console driver before power down and reboot. Implements the flushing function for uart consoles, which includes the astbmc and rhesus platforms. Adds a new function, flush(), to the con_ops struct that allows each console driver to specify how their output buffers are flushed. In the cec_power_down and cec_reboot functions, the flush function of the driver is called if it exists. This fixes an issue where some console output is sometimes lost before power down or reboot in uart consoles. If this issue is also prevalent in other console types then it can be fixed later by adding a .flush to that driver's con_ops. Signed-off-by: Russell Currey [stewart@linux.vnet.ibm.com: reduce diff size, change flush function name] Signed-off-by: Stewart Smith --- core/console.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/console.c') diff --git a/core/console.c b/core/console.c index df3ce3b..f993237 100644 --- a/core/console.c +++ b/core/console.c @@ -290,6 +290,12 @@ ssize_t read(int fd __unused, void *buf, size_t req_count) return count; } +void flush_console_driver(void) +{ + if (con_driver->flush != NULL) + con_driver->flush(); +} + void set_console(struct con_ops *driver) { con_driver = driver; -- cgit v1.1