From ed13cb82b64732132db6007320325b3bc51dcee2 Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Wed, 28 Mar 2018 10:08:58 -0700 Subject: [PATCH] cr50: use system_rollback_detected to detect rollback system_rollback_detected is used to determine if the system rolledback in the rest of the system code base and it's state is saved longer. This change switches board.c to use that to determine the sysinfo output instead of using the reset count. The reset count is cleared when the system boots. Depending on how fast the system boots it may be difficult to read sysinfo before the reset counter is cleared. In these cases it is difficult to tell whether an image has been rejected entirely or the image caused a rollback. BUG=b:71804463 BRANCH=cr50 TEST=boot the device. Make sure sysinfo shows there's no rollback. Rollback and make sure sysinfo shows the system has rolledback Change-Id: Ic29b105c758d0984e47482b9384cf00fe202b716 Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/984393 Commit-Ready: Mary Ruthven Tested-by: Mary Ruthven Reviewed-by: Randall Spangler Reviewed-by: Vadim Bendebury --- board/cr50/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/cr50/board.c b/board/cr50/board.c index 28f6ceca20..3a3eaf6d5a 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -1314,7 +1314,7 @@ static int command_sysinfo(int argc, char **argv) ccprintf("Reset flags: 0x%08x (", system_get_reset_flags()); system_print_reset_flags(); ccprintf(")\n"); - if (reset_count > 6) + if (system_rollback_detected()) ccprintf("Rollback detected\n"); ccprintf("Reset count: %d\n", reset_count);