From 86340a75d22659a2b57077bdd79a63ef91668320 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Wed, 11 Feb 2015 16:29:50 -0800 Subject: [PATCH] cleanup: Poke the watchdog when dumping lots of memory If you use the "md" command to display lots of memory, it can cause the watchdog to trip. This just pokes it every now and then to be sure it's happy. BUG=none BRANCH=none TEST=manual Print a lot, see that it doesn't timeout: md 0 0x4000 Change-Id: Ic4e2746c07f4fbdf922e87ea3efbe90b88ae08c9 Signed-off-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/251011 Reviewed-by: Randall Spangler --- common/memory_commands.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/memory_commands.c b/common/memory_commands.c index d0fa6eb191..fb896a8d4b 100644 --- a/common/memory_commands.c +++ b/common/memory_commands.c @@ -6,7 +6,9 @@ /* System module for Chrome EC */ #include "console.h" +#include "timer.h" #include "util.h" +#include "watchdog.h" static int command_mem_dump(int argc, char **argv) { @@ -31,6 +33,13 @@ static int command_mem_dump(int argc, char **argv) else ccprintf(" %08x", value); cflush(); + + /* Lots of output could take a while. + * Let other things happen, too */ + if (!(i % 0x100)) { + watchdog_reload(); + usleep(10 * MSEC); + } } ccprintf("\n"); cflush();