summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAvaneesh Kumar Dwivedi <akdwived@codeaurora.org>2017-04-21 21:15:03 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-04-28 05:29:41 -0700
commit635cd0dd76c55f7f3a9bd0128b0514353f3bcc36 (patch)
treefb5de8e0514962892be1091881e4fd7ffdfa01bf /drivers
parentb6bd6d1a3c8d4140a1bb9c1011a4c52bf42e46dd (diff)
soc: qcom: Register for indication cb after obtaining state of remote pd
This change moves the registration of indication call back after inquiring the state of remote PD, this is logical flow since in any case just after registration we are inquiring the state and doing client notification. With existing arrangement of code, sometime there is occurring a race condition between inquiring the remote pd state and indication call back. Change-Id: I2d4d5e0dc7afde9dfb89747b878c26862532bec4 Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/soc/qcom/service-notifier.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/soc/qcom/service-notifier.c b/drivers/soc/qcom/service-notifier.c
index 68592feccb33..b5681a5c6817 100644
--- a/drivers/soc/qcom/service-notifier.c
+++ b/drivers/soc/qcom/service-notifier.c
@@ -376,13 +376,6 @@ static void root_service_service_arrive(struct work_struct *work)
mutex_unlock(&qmi_client_release_lock);
pr_info("Connection established between QMI handle and %d service\n",
data->instance_id);
- /* Register for indication messages about service */
- rc = qmi_register_ind_cb(data->clnt_handle, root_service_service_ind_cb,
- (void *)data);
- if (rc < 0)
- pr_err("Indication callback register failed(instance-id: %d) rc:%d\n",
- data->instance_id, rc);
-
mutex_lock(&notif_add_lock);
mutex_lock(&service_list_lock);
list_for_each_entry(service_notif, &service_list, list) {
@@ -405,6 +398,12 @@ static void root_service_service_arrive(struct work_struct *work)
}
mutex_unlock(&service_list_lock);
mutex_unlock(&notif_add_lock);
+ /* Register for indication messages about service */
+ rc = qmi_register_ind_cb(data->clnt_handle,
+ root_service_service_ind_cb, (void *)data);
+ if (rc < 0)
+ pr_err("Indication callback register failed(instance-id: %d) rc:%d\n",
+ data->instance_id, rc);
}
static void root_service_service_exit(struct qmi_client_info *data,