Skip to content

Commit

Permalink
rpmsg: glink: Propagate TX failures in intentless mode as well
Browse files Browse the repository at this point in the history
commit 7a68f9fa97357a0f2073c9c31ed4101da4fce93e upstream.

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: 8956927faed3 ("rpmsg: glink: Add TX_DATA_CONT command while sending")
Reviewed-by: Chris Lew <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
quic-bjorande authored and gregkh committed Dec 5, 2024
1 parent 745f7ce commit 4fbbee6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/rpmsg/qcom_glink_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -1355,8 +1355,9 @@ static int __qcom_glink_send(struct glink_channel *channel,
ret = qcom_glink_tx(glink, &req, sizeof(req), data, chunk_size, wait);

/* Mark intent available if we failed */
if (ret && intent) {
intent->in_use = false;
if (ret) {
if (intent)
intent->in_use = false;
return ret;
}

Expand All @@ -1377,8 +1378,9 @@ static int __qcom_glink_send(struct glink_channel *channel,
chunk_size, wait);

/* Mark intent available if we failed */
if (ret && intent) {
intent->in_use = false;
if (ret) {
if (intent)
intent->in_use = false;
break;
}
}
Expand Down

0 comments on commit 4fbbee6

Please sign in to comment.