From 96f258f04526d6cf188ffe4fe73ec14ea108d5fd Mon Sep 17 00:00:00 2001 From: Yilun Lin Date: Wed, 28 Aug 2019 13:44:54 +0800 Subject: cutoff: ensure logs are flushed before cut-off Logs may not appear in the console without flush if battery been cut-off. TEST=See the logs are flushed to console before cutoff BRANCH=None BUG=None Change-Id: I73363856c50dea1ec409b8041d96227d6538bcc3 Signed-off-by: Yilun Lin Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1772863 Reviewed-by: Nicolas Boichat --- power/common.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'power/common.c') diff --git a/power/common.c b/power/common.c index 5128f46ac8..d6f74d9a1e 100644 --- a/power/common.c +++ b/power/common.c @@ -332,6 +332,8 @@ static enum power_state power_common_state(enum power_state state) #ifdef CONFIG_BATTERY_CUT_OFF case CRITICAL_SHUTDOWN_CUTOFF: CPRINTS("Cutoff due to G3 idle"); + /* Ensure logs are flushed. */ + cflush(); board_cut_off_battery(); break; #endif -- cgit v1.2.1