summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorDhoat Harpal <hdhoat@codeaurora.org>2017-01-05 13:51:59 +0530
committerDhoat Harpal <hdhoat@codeaurora.org>2017-01-05 14:48:19 +0530
commitcd5bd5f58af5402288fc176a1df3945b55720a97 (patch)
tree33cb27f8b465677ffa4ad06b5fa07fc25d4be573 /drivers/soc
parent2f817b68f06ed866aa2c4cc35b2e4293aeb1ef99 (diff)
soc: qcom: glink: Change cleanup sequence in remote close
In function glink_core_remote_close_common, notify_state callback is called before clearing wait queue. This leads to deadlock if client want to synchronize tx and state notify function. Complete_all is called before notify client about state change, so that all pending requests from client will be cleared. CRs-Fixed: 1107652 Change-Id: Ia6c4a305eb42c014a928bad36491e6e5f6eac9d5 Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/glink.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/soc/qcom/glink.c b/drivers/soc/qcom/glink.c
index 65ce7d791a47..33cf48454414 100644
--- a/drivers/soc/qcom/glink.c
+++ b/drivers/soc/qcom/glink.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -582,6 +582,9 @@ static bool glink_core_remote_close_common(struct channel_ctx *ctx, bool safe)
}
ctx->rcid = 0;
+ ctx->int_req_ack = false;
+ complete_all(&ctx->int_req_ack_complete);
+ complete_all(&ctx->int_req_complete);
if (ctx->local_open_state != GLINK_CHANNEL_CLOSED &&
ctx->local_open_state != GLINK_CHANNEL_CLOSING) {
if (ctx->notify_state)
@@ -598,9 +601,6 @@ static bool glink_core_remote_close_common(struct channel_ctx *ctx, bool safe)
"Did not send GLINK_REMOTE_DISCONNECTED",
"local state is already CLOSED");
- ctx->int_req_ack = false;
- complete_all(&ctx->int_req_ack_complete);
- complete_all(&ctx->int_req_complete);
ch_purge_intent_lists(ctx);
return is_fully_closed;