diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2018-05-19 00:12:40 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-23 16:47:50 -0700 |
commit | 7784fba59d7eb7992c2f0e2df24a819fe06c2828 (patch) | |
tree | 4f9508a904f65206a6074a8116ad1bd31c383fd9 | |
parent | 6a2939005d99415e6f305c519caf3d3a5774952a (diff) | |
download | chrome-ec-7784fba59d7eb7992c2f0e2df24a819fe06c2828.tar.gz |
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>
-rw-r--r-- | power/apollolake.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/power/apollolake.c b/power/apollolake.c index c1fcbe8e17..dda74a29b9 100644 --- a/power/apollolake.c +++ b/power/apollolake.c @@ -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; |