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>
This commit is contained in:
Chris Lew 2016-04-30 16:11:26 -07:00 committed by Jeevan Shriram
parent f91d7a5a2b
commit d7e810a2ce

View file

@ -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);