diff options
| author | Dhoat Harpal <hdhoat@codeaurora.org> | 2016-04-18 21:01:02 +0530 |
|---|---|---|
| committer | Jeevan Shriram <jshriram@codeaurora.org> | 2016-05-06 12:06:26 -0700 |
| commit | 9763e34fbcc85ea0e98ab838d89dffdbbc40fe80 (patch) | |
| tree | 614f817962ae7ad43a71a545747233abbb0cd827 | |
| parent | 629e9ceeb79986542c83d6b7a7670f7ff9fff549 (diff) | |
soc: qcom: glink: Fix channel migration on fully open channel
If process_open_event is delayed and glink has migrated to new transport,
process open event will be treated as a new open event and migration will
happen on fully open channel.
If channel is fully, open migration will not be allowed as client might
already be using the channel for communication.
Change-Id: I6c1760bc19f52e7d0c1c9834a72e2304f0ae28c8
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
| -rw-r--r-- | drivers/soc/qcom/glink.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/soc/qcom/glink.c b/drivers/soc/qcom/glink.c index 8c3940b631f3..904953877443 100644 --- a/drivers/soc/qcom/glink.c +++ b/drivers/soc/qcom/glink.c @@ -4305,6 +4305,10 @@ static bool will_migrate(struct channel_ctx *l_ctx, struct channel_ctx *r_ctx) if (l_ctx->local_xprt_req > r_ctx->transport_ptr->id) l_ctx->local_xprt_req = r_ctx->transport_ptr->id; + if (ch_is_fully_opened(l_ctx) && + (l_ctx->transport_ptr->id == l_ctx->local_xprt_req)) + goto exit; + new_xprt = max(l_ctx->local_xprt_req, r_ctx->remote_xprt_req); if (new_xprt == l_ctx->transport_ptr->id) @@ -4355,6 +4359,12 @@ static bool ch_migrate(struct channel_ctx *l_ctx, struct channel_ctx *r_ctx) rwref_put(&r_ctx->ch_state_lhb2); return migrated; } + if (ch_is_fully_opened(l_ctx) && + (l_ctx->transport_ptr->id == l_ctx->local_xprt_req)) { + rwref_put(&l_ctx->ch_state_lhb2); + rwref_put(&r_ctx->ch_state_lhb2); + return migrated; + } if (l_ctx->local_xprt_req == r_ctx->remote_xprt_req && l_ctx->local_xprt_req == l_ctx->transport_ptr->id) |
