diff options
| author | Amir Samuelov <amirs@codeaurora.org> | 2017-09-24 13:40:19 +0300 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-09-28 00:41:26 -0700 |
| commit | aef18b277cf605dbfd0a28ec4c4ce524f908499c (patch) | |
| tree | 7b6de930026dcba4e0feb81dd0d573f592b39077 /drivers/soc | |
| parent | 22b400edb3a3722788750ba8f4f58a1168bd9df8 (diff) | |
spcom: spcom_get_next_request_size() unlock while waiting for rx data
spcom server app might open the channel before the SP client app.
The asynchronous CONNECTED callback might be called while the server
is waiting for data.
Avoid locking the channel while waiting for data to avoid dead lock
while handling the CONNECTED callabck.
Change-Id: I7c576f240b60720a6f1461b3e48f4422c110e7c4
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Diffstat (limited to 'drivers/soc')
| -rw-r--r-- | drivers/soc/qcom/spcom.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/soc/qcom/spcom.c b/drivers/soc/qcom/spcom.c index a49848808078..fddd7083f834 100644 --- a/drivers/soc/qcom/spcom.c +++ b/drivers/soc/qcom/spcom.c @@ -1028,10 +1028,12 @@ static int spcom_get_next_request_size(struct spcom_channel *ch) ch->name, ch->actual_rx_size); goto exit_ready; } + mutex_unlock(&ch->lock); /* unlock while waiting */ pr_debug("Wait for Rx Done, ch [%s].\n", ch->name); wait_for_completion(&ch->rx_done); + mutex_lock(&ch->lock); /* re-lock after waiting */ /* Check Rx Abort on SP reset */ if (ch->rx_abort) { pr_err("rx aborted.\n"); |
