From d94fd4faf554eb5cd48d50bc8ce307e03bc87904 Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Fri, 16 Sep 2016 15:48:49 -0700 Subject: [PATCH] system: Add console print for reboot-on-ap-shutdown If the EC suddenly resets due to a reboot-on-ap-shutdown host command, it's often not obvious why, so add a print. BUG=None TEST=Trigger cold reboot-on-ap-shutdown, verify print is seen on console. BRANCH=Kevin Change-Id: Iada34c9575462e687ffc6267b1ffead394b72bfe Signed-off-by: Shawn Nematbakhsh Reviewed-on: https://chromium-review.googlesource.com/386264 Reviewed-by: Randall Spangler Reviewed-by: Aseda Aboagye (cherry picked from commit ab6f29a02bf36cdcca309b304a07006bebec01e9) Reviewed-on: https://chromium-review.googlesource.com/387628 Commit-Ready: Shawn N Tested-by: Shawn N Reviewed-by: Shawn N --- common/system.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/system.c b/common/system.c index 4488f45e66..0ca7b33643 100644 --- a/common/system.c +++ b/common/system.c @@ -32,6 +32,7 @@ /* Console output macros */ #define CPUTS(outstr) cputs(CC_SYSTEM, outstr) +#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args) #define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args) /* Round up to a multiple of 4 */ @@ -812,6 +813,8 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd) static void system_common_shutdown(void) { + if (reboot_at_shutdown) + CPRINTF("Reboot at shutdown: %d\n", reboot_at_shutdown); handle_pending_reboot(reboot_at_shutdown); } DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, system_common_shutdown, HOOK_PRIO_DEFAULT);