APL/GLK: Clean up UART buffer before shutdown

UART buffer gets overwritten by other tasks if it is not explicitly
flushed before printing it on the console by same task. Hence, clean
up the UART buffer so that all the debug messages are printed on the
UART console before doing shutdown.

BUG=b:79950369
BRANCH=none
TEST=Manually tested on BIP, observed that UART logs are not lost
     on the terminal when apshutdown is issued.

Change-Id: I420e9de9e2e71913ee3168267a6f3a2728b2690b
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1064977
Commit-Ready: Vijay Hiremath <vijay.p.hiremath@intel.corp-partner.google.com>
Tested-by: Vijay Hiremath <vijay.p.hiremath@intel.corp-partner.google.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
This commit is contained in:
Vijay Hiremath
2018-05-19 00:12:40 -07:00
committed by chrome-bot
parent 6a2939005d
commit 7784fba59d

View File

@@ -28,6 +28,14 @@ __attribute__((weak)) void chipset_do_shutdown(void)
static void internal_chipset_shutdown(void)
{
/*
* UART buffer gets overwritten by other tasks if it is not explicitly
* flushed before printing it on the console by same task. Hence, clean
* up the UART buffer so that all the debug messages are printed on the
* UART console before doing shutdown.
*/
cflush();
CPRINTS("%s()", __func__);
force_shutdown = 0;