Skip to content

Commit 7a68f9f

Browse files
quic-bjorandeandersson
authored andcommitted
rpmsg: glink: Propagate TX failures in intentless mode as well
As support for splitting transmission over several messages using TX_DATA_CONT was introduced it does not immediately return the return value of qcom_glink_tx(). The result is that in the intentless case (i.e. intent == NULL), the code will continue to send all additional chunks. This is wasteful, and it's possible that the send operation could incorrectly indicate success, if the last chunk fits in the TX fifo. Fix the condition. Fixes: 8956927 ("rpmsg: glink: Add TX_DATA_CONT command while sending") Reviewed-by: Chris Lew <quic_clew@quicinc.com> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230418163018.785524-2-quic_bjorande@quicinc.com
1 parent c05dfce commit 7a68f9f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

drivers/rpmsg/qcom_glink_native.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,8 +1371,9 @@ static int __qcom_glink_send(struct glink_channel *channel,
13711371
ret = qcom_glink_tx(glink, &req, sizeof(req), data, chunk_size, wait);
13721372

13731373
/* Mark intent available if we failed */
1374-
if (ret && intent) {
1375-
intent->in_use = false;
1374+
if (ret) {
1375+
if (intent)
1376+
intent->in_use = false;
13761377
return ret;
13771378
}
13781379

@@ -1393,8 +1394,9 @@ static int __qcom_glink_send(struct glink_channel *channel,
13931394
chunk_size, wait);
13941395

13951396
/* Mark intent available if we failed */
1396-
if (ret && intent) {
1397-
intent->in_use = false;
1397+
if (ret) {
1398+
if (intent)
1399+
intent->in_use = false;
13981400
break;
13991401
}
14001402
}

0 commit comments

Comments
 (0)