summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2021-04-01 15:58:01 +0000
committerCommit Bot <commit-bot@chromium.org>2021-04-01 19:55:39 +0000
commitd936645464835e970901c0b8e8476382a51d498b (patch)
tree26ebcd4b7196c6e937f15fbbb61b5858ad8b1266
parenta44e7f803e7552b189785b3a2d7127b750661f31 (diff)
downloadchrome-ec-d936645464835e970901c0b8e8476382a51d498b.tar.gz
zephyr: hooks: make deferred queue stack size configurable
The Zephyr implementation of EC hooks is currently using a hardcoded stack size of 1024 bytes. Make it configurable so that we can tweak it on the board configs. BUG=none BRANCH=none TEST=kernel stacks on the EC shell Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I705f18b3a17ca9da62421ae563bbc6a2f8cefbc5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799681 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--zephyr/Kconfig.system7
-rw-r--r--zephyr/shim/src/hooks.c6
2 files changed, 9 insertions, 4 deletions
diff --git a/zephyr/Kconfig.system b/zephyr/Kconfig.system
index 4fb681acc7..d6fd5b07e0 100644
--- a/zephyr/Kconfig.system
+++ b/zephyr/Kconfig.system
@@ -23,4 +23,11 @@ config PLATFORM_EC_SYSTEM_PRE_INIT_PRIORITY
those critical to determining the reset type, should be initialized at
lower priority so that the system reset flags are valid.
+config DEFERRED_STACK_SIZE
+ int "Stack size for deferred calls queue"
+ default 1024
+ help
+ This defines the stack size for the Zephyr implementation of the EC
+ hooks API.
+
endif # PLATFORM_EC
diff --git a/zephyr/shim/src/hooks.c b/zephyr/shim/src/hooks.c
index dee7c20441..fed75d51db 100644
--- a/zephyr/shim/src/hooks.c
+++ b/zephyr/shim/src/hooks.c
@@ -12,8 +12,6 @@
#include "task.h"
#include "timer.h"
-#define DEFERRED_STACK_SIZE 1024
-
/*
* Deferred thread is always the lowest priority, and preemptive if
* available.
@@ -24,7 +22,7 @@
#define DEFERRED_THREAD_PRIORITY -1
#endif
-static K_THREAD_STACK_DEFINE(deferred_thread, DEFERRED_STACK_SIZE);
+static K_THREAD_STACK_DEFINE(deferred_thread, CONFIG_DEFERRED_STACK_SIZE);
static struct k_work_q deferred_work_queue;
static void deferred_work_queue_handler(struct k_work *work)
@@ -39,7 +37,7 @@ static int init_deferred_work_queue(const struct device *unused)
{
ARG_UNUSED(unused);
k_work_q_start(&deferred_work_queue, deferred_thread,
- DEFERRED_STACK_SIZE, DEFERRED_THREAD_PRIORITY);
+ CONFIG_DEFERRED_STACK_SIZE, DEFERRED_THREAD_PRIORITY);
return 0;
}
SYS_INIT(init_deferred_work_queue, APPLICATION, 0);