Commit 12b9f2e4 authored by Charlie Jacobsen's avatar Charlie Jacobsen
Browse files

Use a "request cookie" for thc_ipc_reply.

We don't want to have to hold on to the request message until
we reply. Instead, the libasync user passes in a "request cookie",
that is just the message id. The libasync user obtains the
cookie via thc_get_request_cookie.

Not tested yet.
parent e6867fb4
Subproject commit 2cef3d068d3ed2da556d775f8571f5c2c6b67d63
Subproject commit 06c7d47f536ff569f8ee4d97ee62a7c70ee9b85d
......@@ -196,11 +196,11 @@ EXPORT_SYMBOL(thc_ipc_call);
thc_ipc_reply(struct fipc_ring_channel *chnl,
struct fipc_message *request,
uint32_t request_cookie,
struct fipc_message *response)
thc_set_msg_type(response, msg_type_response);
thc_set_msg_id(response, thc_get_msg_id(request));
thc_set_msg_id(response, request_cookie);
return fipc_send_msg_end(chnl, response);
......@@ -39,6 +39,11 @@ static inline void thc_set_msg_id(struct fipc_message *msg,
fipc_set_flags(msg, flags);
static inline uint32_t thc_get_request_cookie(struct fipc_message *request)
return thc_get_msg_id(request);
int thc_ipc_recv(struct fipc_ring_channel *chnl,
unsigned long msg_id,
struct fipc_message** out_msg);
......@@ -69,8 +69,11 @@ static inline int send_response(struct fipc_ring_channel *chnl,
int ret;
struct fipc_message *response;
uint32_t request_cookie = thc_get_request_cookie(recvd_msg);
* Mark recvd msg slot as available
* Mark recvd msg slot as available.
* NOTE: recvd_msg is not valid after this call.
ret = fipc_recv_msg_end(chnl, recvd_msg);
if (ret) {
......@@ -89,7 +92,7 @@ static inline int send_response(struct fipc_ring_channel *chnl,
set_fn_type(response, type);
response->regs[0] = val;
ret = thc_ipc_reply(chnl, recvd_msg, response);
ret = thc_ipc_reply(chnl, request_cookie, response);
if (ret) {
pr_err("Error marking message as sent");
return ret;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment