diff options
author | Stefan Adolfsson <sadolfsson@chromium.org> | 2018-05-16 15:21:00 +0000 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-16 16:43:03 -0700 |
commit | 86734119fcba3909f02ab294ae3b2b31540c17a7 (patch) | |
tree | ac97b734ab1bd052da058013e3f262b0b63e734e /util | |
parent | e16963ce25831f796acabcfaa870335876a14941 (diff) | |
download | chrome-ec-86734119fcba3909f02ab294ae3b2b31540c17a7.tar.gz |
Reland "npcx: CEC: Send CEC message in mkbp event"
This reverts commit f139d3a0ca9215b5b5bb2abc1f120ff6171036c9.
Reason for revert: Verified that the problem is in the kernel, not EC.
Original change's description:
> Revert "npcx: CEC: Send CEC message in mkbp event"
>
> This reverts commit 74b5a2ccb58739d4e21fdeb36e40fe01c0ca7ede.
>
> Suspected to have broken perf tests by keeping a CPU busy on kevin/bob.
>
> BUG=chromium:842873, b:76467407
>
> Change-Id: Iebbbb4623116840b851656e3ec28e75dc99cff79
> Reviewed-on: https://chromium-review.googlesource.com/1060073
> Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
> Tested-by: Ilja H. Friedel <ihf@chromium.org>
Bug: chromium:842873, b:76467407
Change-Id: I7d8990b2b8901b7de08f190a993bec645bbdacd2
Reviewed-on: https://chromium-review.googlesource.com/1061854
Commit-Ready: Stefan Adolfsson <sadolfsson@chromium.org>
Tested-by: Stefan Adolfsson <sadolfsson@chromium.org>
Reviewed-by: Stefan Adolfsson <sadolfsson@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/ectool.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/util/ectool.c b/util/ectool.c index a80f413165..c13fcdb336 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -7698,7 +7698,7 @@ err: } static int wait_event(long event_type, - struct ec_response_get_next_event *buffer, + struct ec_response_get_next_event_v1 *buffer, size_t buffer_size, long timeout) { int rv; @@ -7712,13 +7712,13 @@ static int wait_event(long event_type, return -EIO; } - return 0; + return rv; } int cmd_wait_event(int argc, char *argv[]) { int rv, i; - struct ec_response_get_next_event buffer; + struct ec_response_get_next_event_v1 buffer; long timeout = 5000; long event_type; char *e; @@ -7783,7 +7783,7 @@ static int cmd_cec_write(int argc, char *argv[]) long val; int rv, i, msg_len; struct ec_params_cec_write p; - struct ec_response_get_next_event buffer; + struct ec_response_get_next_event_v1 buffer; if (argc < 3 || argc > 18) { fprintf(stderr, "Invalid number of params\n"); @@ -7810,7 +7810,7 @@ static int cmd_cec_write(int argc, char *argv[]) if (rv < 0) return rv; - rv = wait_event(EC_MKBP_EVENT_CEC, &buffer, sizeof(buffer), 1000); + rv = wait_event(EC_MKBP_EVENT_CEC_EVENT, &buffer, sizeof(buffer), 1000); if (rv < 0) return rv; @@ -7829,10 +7829,9 @@ static int cmd_cec_write(int argc, char *argv[]) static int cmd_cec_read(int argc, char *argv[]) { - int msg_len, i, rv; + int i, rv; char *e; - struct ec_response_cec_read r; - struct ec_response_get_next_event buffer; + struct ec_response_get_next_event_v1 buffer; long timeout = 5000; if (!ec_pollevent) { @@ -7848,21 +7847,14 @@ static int cmd_cec_read(int argc, char *argv[]) } } - rv = wait_event(EC_MKBP_EVENT_CEC, &buffer, sizeof(buffer), timeout); + rv = wait_event(EC_MKBP_EVENT_CEC_MESSAGE, &buffer, + sizeof(buffer), timeout); if (rv < 0) return rv; - printf("Got CEC events 0x%08x\n", buffer.data.cec_events); - - rv = ec_command(EC_CMD_CEC_READ_MSG, 0, NULL, 0, &r, sizeof(r)); - if (rv < 0) - return rv; - - msg_len = rv; - printf("CEC data: "); - for (i = 0; i < msg_len; i++) - printf("0x%02x ", r.msg[i]); + for (i = 0; i < rv - 1; i++) + printf("0x%02x ", buffer.data.cec_message[i]); printf("\n"); return 0; |