summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorChris Lew <clew@codeaurora.org>2016-04-30 16:11:26 -0700
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-10 13:20:19 -0700
commitd7e810a2ce43d982148778c6006fce0c72f99ecf (patch)
tree313b4d0378f44cb67f25888e91719f1e2eb82db0 /drivers/soc
parentf91d7a5a2bc707296ea15e4e459dcfb3e8a49e93 (diff)
soc: qcom: glink: Fix ssr race condition in glink_close
Add else statement in glink_close for a race condition where the xprt state is set to GLINK_XPRT_DOWN and glink_close runs before the channel is migrated. CRs-Fixed: 988266 Change-Id: I4de6530f1fbffd9f3acd1fa539cf756364ea32ac Signed-off-by: Chris Lew <clew@codeaurora.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/glink.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/soc/qcom/glink.c b/drivers/soc/qcom/glink.c
index 904953877443..498e45e2dd1b 100644
--- a/drivers/soc/qcom/glink.c
+++ b/drivers/soc/qcom/glink.c
@@ -2631,6 +2631,13 @@ relock: xprt_ctx = ctx->transport_ptr;
"channel Not closed yet local state [%d] remote_state [%d]\n",
ctx->local_open_state, ctx->remote_opened);
}
+ } else {
+ /*
+ * This case handles the scenario where glink_core_link_down
+ * changes the local_state to GLINK_XPRT_DOWN but glink_close
+ * gets the channel write lock before glink_core_channel_cleanup
+ */
+ rwref_write_put(&ctx->ch_state_lhb2);
}
complete_all(&ctx->int_req_ack_complete);
complete_all(&ctx->int_req_complete);