summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjorn Andersson <quic_bjorande@quicinc.com>2023-04-18 09:30:17 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-05 10:59:41 +0100
commit4fbbee6fa5de35572a27f44d6c87c4cea9a13abe (patch)
tree88e6f3cbb1b6a9a0064e1b740ab092478a913974
parent745f7ce5a95e783ba62fe774325829466aec2aa8 (diff)
rpmsg: glink: Propagate TX failures in intentless mode as well
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 <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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/rpmsg/qcom_glink_native.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index 233975267f73..17c342b4fe72 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -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;
}
@@ -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;
}
}