summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei-Ning Huang <wnhuang@google.com>2017-05-02 19:32:52 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-05-06 19:52:32 -0700
commit8c26ccbc151e8e270e04af74719d5e4befcc8ff3 (patch)
tree887ad44804131db4a7384be510462fd7b3311a0a
parenta5a3fa2d13b4b18f1244ae408a778c5e88130a6f (diff)
downloadchrome-ec-8c26ccbc151e8e270e04af74719d5e4befcc8ff3.tar.gz
uart: add config to optionally enable EC_CMD_CONSOLE_READ v1
The cros_ec_debugfs creates the `console_log` debugfs entry if EC supports EC_CMD_CONSOLE_READ version 1. On device where i2c command latency is critical, periodic console_read is impacting the timing of commands. BRANCH=none BUG=b:37584134 TEST=on rose with CONFIG_CONSOLE_ENABLE_READ_V1 undefined, the kernel should not create cros_tp/console_log. Change-Id: I40d0b959ef36f2f410155fa30e01c8169032a3e9 Signed-off-by: Wei-Ning Huang <wnhuang@google.com> Reviewed-on: https://chromium-review.googlesource.com/494546 Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org> Tested-by: Wei-Ning Huang <wnhuang@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
-rw-r--r--common/uart_buffering.c8
-rw-r--r--include/config.h6
2 files changed, 13 insertions, 1 deletions
diff --git a/common/uart_buffering.c b/common/uart_buffering.c
index b81c8cf065..e8dfacd11d 100644
--- a/common/uart_buffering.c
+++ b/common/uart_buffering.c
@@ -405,6 +405,7 @@ static int host_command_console_read(struct host_cmd_handler_args *args)
* snapshot.
*/
return console_read_helper(args, &tx_snapshot_tail);
+#ifdef CONFIG_CONSOLE_ENABLE_READ_V1
} else if (args->version == 1) {
/* Check the params to figure out where to start reading. */
p = args->params;
@@ -413,9 +414,14 @@ static int host_command_console_read(struct host_cmd_handler_args *args)
else if (p->subcmd == CONSOLE_READ_RECENT)
return console_read_helper(args,
&tx_last_snapshot_head);
+#endif
}
return EC_RES_INVALID_PARAM;
}
DECLARE_HOST_COMMAND(EC_CMD_CONSOLE_READ,
host_command_console_read,
- EC_VER_MASK(0) | EC_VER_MASK(1));
+ EC_VER_MASK(0)
+#ifdef CONFIG_CONSOLE_ENABLE_READ_V1
+ | EC_VER_MASK(1)
+#endif
+ );
diff --git a/include/config.h b/include/config.h
index 2b08abde9b..817dc659f6 100644
--- a/include/config.h
+++ b/include/config.h
@@ -775,6 +775,12 @@
#undef CONFIG_CONSOLE_COMMAND_FLAGS_DEFAULT
/*
+ * Enable EC_CMD_CONSOLE_READ V1. One could disable this config to prevent
+ * kernel from creating the `console_log` debugfs entry.
+ */
+#define CONFIG_CONSOLE_ENABLE_READ_V1
+
+/*
* Number of entries in console history buffer.
*
* Boards may #undef this to reduce memory usage.