summaryrefslogtreecommitdiff
path: root/zephyr/shim/src
diff options
context:
space:
mode:
authorRob Barnes <robbarnes@google.com>2022-11-29 23:27:11 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-30 17:14:11 +0000
commiteea5b0dfff88ec51f23b5d4f1290dcfcc327c8df (patch)
treeb0774a87468b8f49dc490262422cdc1d2915ba6d /zephyr/shim/src
parent42c5871768555b69026135cdbfc846744ace27e8 (diff)
downloadchrome-ec-eea5b0dfff88ec51f23b5d4f1290dcfcc327c8df.tar.gz
console: Don't call console_buf_notify_chars from isr
Check if in isr before calling uart_write_char in uart_write_char. console_buf_notify_chars attempts to acquire a mutex, which isn't allowed from an isr. BUG=None BRANCH=None TEST=Pass rw_safe_mode tests Change-Id: If5a5a4c99fae9342f2e1e3c1bf0c841e5490f692 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4065004 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/shim/src')
-rw-r--r--zephyr/shim/src/console.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zephyr/shim/src/console.c b/zephyr/shim/src/console.c
index 6e78fc29c8..fa6dc5a613 100644
--- a/zephyr/shim/src/console.c
+++ b/zephyr/shim/src/console.c
@@ -322,7 +322,7 @@ void uart_write_char(char c)
{
uart_poll_out(uart_shell_dev, c);
- if (IS_ENABLED(CONFIG_PLATFORM_EC_HOSTCMD_CONSOLE))
+ if (IS_ENABLED(CONFIG_PLATFORM_EC_HOSTCMD_CONSOLE) && !k_is_in_isr())
console_buf_notify_chars(&c, 1);
}