From 1066c43cb64399e75d810cd0b6d126c0d153407d Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Thu, 27 Feb 2020 14:15:04 -0700 Subject: common/keyboard_8042: Add logging to keyboard_clear_buffer It's useful to know when the buffer has been cleared. BUG=b:145575366 BRANCH=none TEST=Saw x in kblog Signed-off-by: Raul E Rangel Change-Id: I1c3474687c91a3e017d7a7a0e4e7967c3fb10f05 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2079693 Reviewed-by: Edward Hill --- common/keyboard_8042.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c index 3e17e1736f..feac0dd7f3 100644 --- a/common/keyboard_8042.c +++ b/common/keyboard_8042.c @@ -173,6 +173,8 @@ struct kblog_t { * k = to-host queue head pointer before byte dequeued * K = byte actually sent to host via LPC * + * x = to_host queue was cleared + * * The to-host head and tail pointers are logged pre-wrapping to the * queue size. This means that they continually increment as units * are dequeued and enqueued respectively. Since only the bottom @@ -386,7 +388,9 @@ static void reset_rate_and_delay(void) void keyboard_clear_buffer(void) { + CPRINTS("KB Clear Buffer"); mutex_lock(&to_host_mutex); + kblog_put('x', queue_count(&to_host)); queue_init(&to_host); mutex_unlock(&to_host_mutex); lpc_keyboard_clear_buffer(); -- cgit v1.2.1