diff options
author | Peter Marheine <pmarheine@chromium.org> | 2022-10-11 17:16:17 +1100 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-10-19 04:53:48 +0000 |
commit | c58ec4493f1f92393aed671b96c6063646c068c7 (patch) | |
tree | 81988a7a02e3f0e07de0a497958c36d27691a818 | |
parent | 2679581d743a510cdbcde68f9dd8c24a2d974c7b (diff) | |
download | chrome-ec-c58ec4493f1f92393aed671b96c6063646c068c7.tar.gz |
zephyr: reduce priority of shell thread
Using EC task priority alone ignores other zephyr threads and tends to
give the shell thread higher priority than makes sense; higher priority
than motion sensors and power sequencing for instance. Reduce the default
shell thread priority to be prioritized after most threads except the
work queue and idle tasks.
This removes the explicit call to k_thread_priority_set in shell
initialization because the EC kconfig defaults already request a custom
priority by setting CONFIG_SHELL_THREAD_PRIORITY_OVERRIDE so it is
redundant to set the priority again after shell_init().
BUG=b:240485526
TEST=Nereid still works normally (though performance doesn't seem improved)
BRANCH=none
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Change-Id: I62bf4bc41da78d1d992e3bc0b762eb329fc8ea82
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3944072
Reviewed-by: Yuval Peress <peress@google.com>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r-- | zephyr/Kconfig.defaults | 2 | ||||
-rw-r--r-- | zephyr/shim/src/console.c | 10 |
2 files changed, 1 insertions, 11 deletions
diff --git a/zephyr/Kconfig.defaults b/zephyr/Kconfig.defaults index ded7516748..e0992f91fa 100644 --- a/zephyr/Kconfig.defaults +++ b/zephyr/Kconfig.defaults @@ -29,7 +29,7 @@ config SHELL_THREAD_PRIORITY_OVERRIDE default y config SHELL_THREAD_PRIORITY - default 12 # track EC_SHELL_PRIO + default 20 config EXTRA_EXCEPTION_INFO default y if ARCH_HAS_EXTRA_EXCEPTION_INFO diff --git a/zephyr/shim/src/console.c b/zephyr/shim/src/console.c index 2d0476149c..91f9014dac 100644 --- a/zephyr/shim/src/console.c +++ b/zephyr/shim/src/console.c @@ -40,9 +40,6 @@ #error Must select only one shell backend #endif -BUILD_ASSERT(EC_TASK_PRIORITY(EC_SHELL_PRIO) == CONFIG_SHELL_THREAD_PRIORITY, - "EC_SHELL_PRIO does not match CONFIG_SHELL_THREAD_PRIORITY."); - LOG_MODULE_REGISTER(shim_console, LOG_LEVEL_ERR); static const struct device *uart_shell_dev = @@ -169,13 +166,6 @@ static void shell_init_from_work(struct k_work *work) shell_init(shell_zephyr, uart_shell_dev, shell_cfg_flags, log_backend, level); - /* - * shell_init() always resets the priority back to the default. - * Update the priority as setup by the shimmed task code. - */ - k_thread_priority_set(shell_zephyr->ctx->tid, - EC_TASK_PRIORITY(EC_SHELL_PRIO)); - #if defined(CONFIG_UART_INTERRUPT_DRIVEN) uart_irq_rx_enable(uart_shell_dev); uart_irq_tx_enable(uart_shell_dev); |