summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-04-09 19:29:19 -0600
committerchrome-bot <chrome-bot@chromium.org>2019-04-12 14:50:00 -0700
commit3eb986572c138b3f3699b2de36560e564f486c3b (patch)
tree67848c4e9e9f97475f830000139967eec06215e0
parenta256570f5fbe9605500f66aaf1b2484c09229d96 (diff)
downloadchrome-ec-3eb986572c138b3f3699b2de36560e564f486c3b.tar.gz
ish: send request id back as response id
The AP needs a way to pair request and response messages as they come in asynchronously or late. This does not help the normal case, but the error case when the responses get behind. BRANCH=none BUG=b:130039715 TEST=See that kernel messages get dropped instead of error because of mismatched size (which is a signal that responses were getting paired up incorrectly) Change-Id: I7ddee42aac03429e4fc6cccd47527cf4776cff04 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1560651 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Rushikesh S Kadam <rushikesh.s.kadam@intel.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--chip/ish/host_command_heci.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/chip/ish/host_command_heci.c b/chip/ish/host_command_heci.c
index 463a5bb4a0..3676451cc9 100644
--- a/chip/ish/host_command_heci.c
+++ b/chip/ish/host_command_heci.c
@@ -32,7 +32,8 @@ static heci_handle_t heci_cros_ec_handle = HECI_INVALID_HANDLE;
struct cros_ec_ishtp_msg_hdr {
uint8_t channel;
uint8_t status;
- uint8_t reserved[2];
+ uint8_t id; /* Pairs up request and responses */
+ uint8_t reserved;
} __ec_align4;
#define CROS_EC_ISHTP_MSG_HDR_SIZE sizeof(struct cros_ec_ishtp_msg_hdr)
@@ -70,6 +71,8 @@ static void heci_send_hostcmd_response(struct host_packet *pkt)
out->hdr.channel = CROS_EC_COMMAND;
out->hdr.status = 0;
+ /* id is already set in the receiving method */
+
rv = heci_send_msg(heci_cros_ec_handle, (uint8_t *)out,
pkt->response_size + CROS_EC_ISHTP_MSG_HDR_SIZE);
if (rv < 0)
@@ -88,6 +91,9 @@ static void cros_ec_ishtp_subsys_new_msg_received(const heci_handle_t handle,
}
memset(&heci_packet, 0, sizeof(heci_packet));
+ /* Copy over id from sender so they can pair up messages */
+ out->hdr.id = in->hdr.id;
+
heci_packet.send_response = heci_send_hostcmd_response;
heci_packet.request = in->data;