aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/cyclic.c12
-rw-r--r--include/cyclic.h2
2 files changed, 10 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;
}
}
}
diff --git a/include/cyclic.h b/include/cyclic.h
index 7601636433..9c5c4fcc54 100644
--- a/include/cyclic.h
+++ b/include/cyclic.h
@@ -39,6 +39,7 @@ struct cyclic_drv {
* @run_cnt: Counter of executions occurances
* @next_call: Next time in us, when the function shall be executed again
* @list: List node
+ * @already_warned: Flag that we've warned about exceeding CPU time usage
*/
struct cyclic_info {
void (*func)(void *ctx);
@@ -50,6 +51,7 @@ struct cyclic_info {
uint64_t run_cnt;
uint64_t next_call;
struct list_head list;
+ bool already_warned;
};
/** Function type for cyclic functions */