cyclic: Use schedule() instead of WATCHDOG_RESET()
Globally replace all occurances of WATCHDOG_RESET() with schedule(), which handles the HW_WATCHDOG functionality and the cyclic infrastructure. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
This commit is contained in:
@@ -27,7 +27,7 @@ static int dm_test_cyclic_running(struct unit_test_state *uts)
|
||||
NULL));
|
||||
|
||||
/* Execute all registered cyclic functions */
|
||||
WATCHDOG_RESET();
|
||||
schedule();
|
||||
ut_asserteq(true, cyclic_active);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <cyclic.h>
|
||||
#include <dm.h>
|
||||
#include <wdt.h>
|
||||
#include <asm/gpio.h>
|
||||
@@ -130,7 +131,7 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts)
|
||||
/* Neither device should be "started", so watchdog_reset() should be a no-op. */
|
||||
reset_count = state->wdt.reset_count;
|
||||
val = sandbox_gpio_get_value(gpio, offset);
|
||||
watchdog_reset();
|
||||
cyclic_run();
|
||||
ut_asserteq(reset_count, state->wdt.reset_count);
|
||||
ut_asserteq(val, sandbox_gpio_get_value(gpio, offset));
|
||||
|
||||
@@ -140,19 +141,19 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts)
|
||||
|
||||
/* Make sure both devices have just been pinged. */
|
||||
timer_test_add_offset(100);
|
||||
watchdog_reset();
|
||||
cyclic_run();
|
||||
reset_count = state->wdt.reset_count;
|
||||
val = sandbox_gpio_get_value(gpio, offset);
|
||||
|
||||
/* The gpio watchdog should be pinged, the sandbox one not. */
|
||||
timer_test_add_offset(30);
|
||||
watchdog_reset();
|
||||
cyclic_run();
|
||||
ut_asserteq(reset_count, state->wdt.reset_count);
|
||||
ut_asserteq(!val, sandbox_gpio_get_value(gpio, offset));
|
||||
|
||||
/* After another ~30ms, both devices should get pinged. */
|
||||
timer_test_add_offset(30);
|
||||
watchdog_reset();
|
||||
cyclic_run();
|
||||
ut_asserteq(reset_count + 1, state->wdt.reset_count);
|
||||
ut_asserteq(val, sandbox_gpio_get_value(gpio, offset));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user