]> Git Repo - linux.git/commitdiff
rpmsg: glink: Propagate TX failures in intentless mode as well
authorBjorn Andersson <[email protected]>
Tue, 18 Apr 2023 16:30:17 +0000 (09:30 -0700)
committerBjorn Andersson <[email protected]>
Wed, 19 Apr 2023 19:43:19 +0000 (12:43 -0700)
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]
drivers/rpmsg/qcom_glink_native.c

index 196ca7d8df7cf4895288a1caba053f8e00bc2f5d..916c0dbe4213870e1de27bfa3bfba66ece747076 100644 (file)
@@ -1371,8 +1371,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;
        }
 
@@ -1393,8 +1394,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;
                }
        }
This page took 0.060424 seconds and 4 git commands to generate.