summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVidyakumar Athota <vathota@codeaurora.org>2016-10-19 17:55:26 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-10-24 17:03:40 -0700
commitb51f826e9f3902e6e4d406ad802b39183bbd5226 (patch)
tree6f02514120d207f596235c3a8b35fc6abd6961da
parent46aa49c1188a77f52dc4969f82292c176d8f399b (diff)
soc: qcom: use interruptible wait_for_completion API
Device suspend fails because of un-interruptible blocking read function. Use wait_for_completion_interruptible API instead of wait_for_completion to allow device suspend. Change-Id: Ia537e776d0b322d56cd6003f95cdded5e695ceeb Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
-rw-r--r--drivers/soc/qcom/wcd-dsp-glink.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/soc/qcom/wcd-dsp-glink.c b/drivers/soc/qcom/wcd-dsp-glink.c
index 92cdadef715d..97d922fa5724 100644
--- a/drivers/soc/qcom/wcd-dsp-glink.c
+++ b/drivers/soc/qcom/wcd-dsp-glink.c
@@ -216,9 +216,9 @@ static bool wdsp_glink_notify_rx_intent_req(void *handle, const void *priv,
mutex_lock(&ch->mutex);
rc = glink_queue_rx_intent(ch->handle, ch, req_size);
- if (IS_ERR_VALUE(ret)) {
- dev_err(wpriv->dev, "%s: Failed to queue rx intent\n",
- __func__);
+ if (IS_ERR_VALUE(rc)) {
+ dev_err(wpriv->dev, "%s: Failed to queue rx intent, rc = %d\n",
+ __func__, rc);
mutex_unlock(&ch->mutex);
goto done;
}
@@ -659,10 +659,13 @@ static ssize_t wdsp_glink_read(struct file *file, char __user *buf,
count = WDSP_MAX_READ_SIZE;
}
/*
- * This is unblocked only from glink rx notification callback
- * or from flush API.
+ * Complete signal has given from glink rx notification callback
+ * or from flush API. Also use interruptible wait_for_completion API
+ * to allow the system to go in suspend.
*/
- wait_for_completion(&wpriv->rsp_complete);
+ ret = wait_for_completion_interruptible(&wpriv->rsp_complete);
+ if (ret)
+ goto done;
mutex_lock(&wpriv->rsp_mutex);
if (wpriv->rsp_cnt) {