summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2021-06-09 11:57:47 +0000
committerCommit Bot <commit-bot@chromium.org>2021-06-09 20:26:55 +0000
commit8efe33cea47f07887b36d16652f698144d428616 (patch)
treef65d41ade06918ee8d09e7438e0aac441d6bbee7
parenta31e654b7e3271f8b77cea9f3e8051c04c2853d3 (diff)
downloadchrome-ec-8efe33cea47f07887b36d16652f698144d428616.tar.gz
zephyr: hooks: suppress hook warning for call already processing
Suppress warning for -EINVAL on k_delayed_work_submit. It indicates that the work is already pending or executing, which is normally harmless. Verified it for charge_manager_refresh. BRANCH=none BUG=b:190214907 TEST=build and run on volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I7048ad15bbb99fc43b663b4f2c6624166a05f0dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2949054 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/shim/src/hooks.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/zephyr/shim/src/hooks.c b/zephyr/shim/src/hooks.c
index 20f3f84704..e60a12a602 100644
--- a/zephyr/shim/src/hooks.c
+++ b/zephyr/shim/src/hooks.c
@@ -22,11 +22,15 @@ int hook_call_deferred(const struct deferred_data *data, int us)
k_delayed_work_cancel(work);
} else if (us >= 0) {
rv = k_delayed_work_submit(work, K_USEC(us));
- if (rv < 0)
+ if (rv == -EINVAL) {
+ /* Already processing or completed. */
+ return 0;
+ } else if (rv < 0) {
cprints(CC_HOOK,
"Warning: deferred call not submitted, "
"deferred_data=0x%pP, err=%d",
data, rv);
+ }
} else {
return EC_ERROR_PARAM2;
}