qseecom: Add a status field to the listener resp structure
When a client thread waiting for a response from a listener,
gets aborted pre-maturely, we need to signal the QSEE that
the comamnd issued by the secure app to the listener service
was not processed succesfully.
Adding status field in the listener resp type enables the
the qseecom driver to do the above.
Change-Id: I4380dc8c314877b372dc67859c1446c10c4ecbdd
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
diff --git a/arch/arm/mach-msm/include/mach/qseecomi.h b/arch/arm/mach-msm/include/mach/qseecomi.h
index 893645a..3a13af8 100644
--- a/arch/arm/mach-msm/include/mach/qseecomi.h
+++ b/arch/arm/mach-msm/include/mach/qseecomi.h
@@ -111,6 +111,7 @@
__packed struct qseecom_client_listener_data_irsp {
uint32_t qsee_cmd_id;
uint32_t listener_id;
+ uint32_t status;
};
/*
diff --git a/drivers/misc/qseecom.c b/drivers/misc/qseecom.c
index 7c458e7..2910a37 100644
--- a/drivers/misc/qseecom.c
+++ b/drivers/misc/qseecom.c
@@ -484,6 +484,7 @@
struct qseecom_command_scm_resp *resp)
{
int ret = 0;
+ int rc = 0;
uint32_t lstnr;
unsigned long flags;
struct qseecom_client_listener_data_irsp send_data_rsp;
@@ -522,8 +523,12 @@
if (data->abort) {
pr_err("Aborting listener service %d\n",
data->listener.id);
- return -ENODEV;
+ rc = -ENODEV;
+ send_data_rsp.status = QSEOS_RESULT_FAILURE;
+ } else {
+ send_data_rsp.status = QSEOS_RESULT_SUCCESS;
}
+
qseecom.send_resp_flag = 0;
send_data_rsp.qsee_cmd_id = QSEOS_LISTENER_DATA_RSP_COMMAND;
send_data_rsp.listener_id = lstnr ;
@@ -542,6 +547,9 @@
return -EINVAL;
}
}
+ if (rc)
+ return rc;
+
return ret;
}