soc: qcom: spcom: return EINTR on wait interrupted

wait_for_completion_interruptible() returns ERESTARTSYS when
the device goes to low power mode.
The SPU subsystem is shutdown on deep low power mode,
so the interrupted operation is not recoverable.
return EINTR to user space to propagate the error to the user app.

Change-Id: I3b47b971d4411f977a0f68c1ce838fd92198c75d
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
This commit is contained in:
Amir Samuelov 2020-03-18 07:22:05 +02:00 • committed by Gerrit - the friendly Code Review server
commit 613dfc140f

View file

@ -502,11 +502,9 @@ static int spcom_rx(struct spcom_channel *ch,
spcom_pr_warn("rpmsg channel is closing\n");
ret = -ERESTART;
goto exit_err;
} else if (ret < 0 || timeleft == -ERESTARTSYS) {
spcom_pr_dbg("wait interrupted: ret=%d, timeleft=%ld\n",
ret, timeleft);
if (timeleft == -ERESTARTSYS)
ret = -ERESTARTSYS;
} else if (ret < 0 || timeleft < 0) {
spcom_pr_err("rx wait was interrupted!");
ret = -EINTR; /* abort, not restartable */
goto exit_err;
} else if (ch->actual_rx_size) {
spcom_pr_dbg("actual_rx_size is [%zu], txn_id %d\n",