summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2022-10-17 10:00:58 +0300
committerStefan Roese <sr@denx.de>2022-10-24 12:10:21 +0300
commitddc8d36a745517fec57787ec9b17ab44c7ad973c (patch)
tree4e0d0b553055c7089958516abb2faf66b5ed732f /common
parent374d5d9971d70f1bf9443d75b5dea03701edcfeb (diff)
downloadu-boot-ddc8d36a745517fec57787ec9b17ab44c7ad973c.tar.xz
cyclic: Don't disable cylic function upon exceeding CPU time
With the migration of the watchdog infrastructure to cyclic functions it's been noticed, that at least one watchdog driver is broken now. As the execution time of it's watchdog reset function is quite long. In general it's not really necessary (right now) to disable the cyclic function upon exceeding CPU time usage. So instead of disabling the cylic function in this case, let's just print a warning once to show this potential problem to the user. Signed-off-by: Stefan Roese <sr@denx.de> Suggested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Cc: Tom Rini <trini@konsulko.com> Cc: Pali Rohár <pali@kernel.org>
Diffstat (limited to 'common')
-rw-r--r--common/cyclic.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/common/cyclic.c b/common/cyclic.c
index b3c180bd1a..7abb82c16a 100644
--- a/common/cyclic.c
+++ b/common/cyclic.c
@@ -85,13 +85,17 @@ void cyclic_run(void)
cyclic->cpu_time_us += cpu_time;
/* Check if cpu-time exceeds max allowed time */
- if (cpu_time > CONFIG_CYCLIC_MAX_CPU_TIME_US) {
- pr_err("cyclic function %s took too long: %lldus vs %dus max, disabling\n",
+ if ((cpu_time > CONFIG_CYCLIC_MAX_CPU_TIME_US) &&
+ (!cyclic->already_warned)) {
+ pr_err("cyclic function %s took too long: %lldus vs %dus max\n",
cyclic->name, cpu_time,
CONFIG_CYCLIC_MAX_CPU_TIME_US);
- /* Unregister this cyclic function */
- cyclic_unregister(cyclic);
+ /*
+ * Don't disable this function, just warn once
+ * about this exceeding CPU time usage
+ */
+ cyclic->already_warned = true;
}
}
}