mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-13 03:15:06 +00:00
Allow repeated waitms commands without resetting
At present issuing several 'waitms 1000' commands immediately after each other trips the watchdog. Add a watchdog reload to avoid this. Also document the behaviour in the command help. BUG=b:72542719 BRANCH=none TEST=manually on grunt, pasting these three lines in: waitms 1000 waitms 1000 waitms 1000 and see that it does not reset now. Change-Id: I453708299e4e26c1bbdb5fc406f26e916e7389af Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/955927 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "util.h"
|
||||
#include "task.h"
|
||||
#include "timer.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
#define TIMER_SYSJUMP_TAG 0x4d54 /* "TM" */
|
||||
|
||||
@@ -265,13 +266,25 @@ static int command_wait(int argc, char **argv)
|
||||
if (*e)
|
||||
return EC_ERROR_PARAM1;
|
||||
|
||||
/*
|
||||
* Waiting for too long (e.g. 3s) will cause the EC to reset due to a
|
||||
* watchdog timeout. This is intended behaviour and is in fact used by
|
||||
* a FAFT test to check that the watchdog timer is working.
|
||||
*/
|
||||
udelay(i * 1000);
|
||||
|
||||
/*
|
||||
* Reload the watchdog so that issuing multiple small waitms commands
|
||||
* quickly one after the other will not cause a reset.
|
||||
*/
|
||||
watchdog_reload();
|
||||
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
/* Typically a large delay (e.g. 3s) will cause a reset */
|
||||
DECLARE_CONSOLE_COMMAND(waitms, command_wait,
|
||||
"msec",
|
||||
"Busy-wait for msec");
|
||||
"Busy-wait for msec (large delays will reset)");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_FORCETIME
|
||||
|
||||
Reference in New Issue
Block a user