Hello Felix Singer, Matt Delco, Patrick Georgi, Furquan Shaikh, Julius Werner, Angel Pons, Patrick Rudolph, EricR Lai,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/47087
to review the following change.
Change subject: libpayload/keyboard: Add timestamp to track time spent in a state ......................................................................
libpayload/keyboard: Add timestamp to track time spent in a state
Will be used to time out in states that don't always advance.
Change-Id: I28235e7638d8157cedf81fd915a41d28a1fc070b Signed-off-by: Nico Huber nico.h@gmx.de --- M payloads/libpayload/drivers/i8042/keyboard.c 1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/47087/1
diff --git a/payloads/libpayload/drivers/i8042/keyboard.c b/payloads/libpayload/drivers/i8042/keyboard.c index 27abd95..a30bdaf 100644 --- a/payloads/libpayload/drivers/i8042/keyboard.c +++ b/payloads/libpayload/drivers/i8042/keyboard.c @@ -249,6 +249,8 @@ STATE_RUNNING, } keyboard_state;
+uint64_t state_time; + static void keyboard_poll(void) { enum keyboard_state next_state = keyboard_state; @@ -289,8 +291,10 @@ break; }
- if (keyboard_state != next_state) + if (keyboard_state != next_state) { keyboard_state = next_state; + state_time = timer_us(0); + } }
bool keyboard_havechar(void) @@ -448,6 +452,7 @@ keyboard_drain_input();
keyboard_state = STATE_CONFIGURE; + state_time = timer_us(0);
console_add_input_driver(&cons); }
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47087 )
Change subject: libpayload/keyboard: Add timestamp to track time spent in a state ......................................................................
Patch Set 1: Code-Review+1
Hello Felix Singer, build bot (Jenkins), Matt Delco, Patrick Georgi, Furquan Shaikh, Angel Pons, Julius Werner, Patrick Rudolph, EricR Lai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47087
to look at the new patch set (#2).
Change subject: libpayload/keyboard: Add timestamp to track time spent in a state ......................................................................
libpayload/keyboard: Add timestamp to track time spent in a state
Will be used to time out in states that don't always advance.
Change-Id: I28235e7638d8157cedf81fd915a41d28a1fc070b Signed-off-by: Nico Huber nico.h@gmx.de --- M payloads/libpayload/drivers/i8042/keyboard.c 1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/47087/2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47087 )
Change subject: libpayload/keyboard: Add timestamp to track time spent in a state ......................................................................
Patch Set 2: Code-Review+1
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47087 )
Change subject: libpayload/keyboard: Add timestamp to track time spent in a state ......................................................................
Patch Set 3: Code-Review+2
Hung-Te Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47087 )
Change subject: libpayload/keyboard: Add timestamp to track time spent in a state ......................................................................
libpayload/keyboard: Add timestamp to track time spent in a state
Will be used to time out in states that don't always advance.
Change-Id: I28235e7638d8157cedf81fd915a41d28a1fc070b Signed-off-by: Nico Huber nico.h@gmx.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/47087 Reviewed-by: Angel Pons th3fanbus@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M payloads/libpayload/drivers/i8042/keyboard.c 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/payloads/libpayload/drivers/i8042/keyboard.c b/payloads/libpayload/drivers/i8042/keyboard.c index dcba031..114e18b 100644 --- a/payloads/libpayload/drivers/i8042/keyboard.c +++ b/payloads/libpayload/drivers/i8042/keyboard.c @@ -245,6 +245,7 @@ } keyboard_state;
static uint64_t keyboard_time; +static uint64_t state_time;
static void keyboard_poll(void) { @@ -334,8 +335,10 @@ break; }
- if (keyboard_state != next_state) + if (keyboard_state != next_state) { keyboard_state = next_state; + state_time = timer_us(0); + } }
bool keyboard_havechar(void) @@ -489,7 +492,7 @@ i8042_cmd(I8042_CMD_EN_KB);
keyboard_state = STATE_DISABLE_SCAN; - keyboard_time = timer_us(0); + keyboard_time = state_time = timer_us(0);
console_add_input_driver(&cons); }