]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Dec 2024 12:35:20 +0000 (13:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Dec 2024 12:35:20 +0000 (13:35 +0100)
added patches:
rpmsg-glink-propagate-tx-failures-in-intentless-mode-as-well.patch

queue-4.19/rpmsg-glink-propagate-tx-failures-in-intentless-mode-as-well.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/rpmsg-glink-propagate-tx-failures-in-intentless-mode-as-well.patch b/queue-4.19/rpmsg-glink-propagate-tx-failures-in-intentless-mode-as-well.patch
new file mode 100644 (file)
index 0000000..f4e37ba
--- /dev/null
@@ -0,0 +1,56 @@
+From 7a68f9fa97357a0f2073c9c31ed4101da4fce93e Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <quic_bjorande@quicinc.com>
+Date: Tue, 18 Apr 2023 09:30:17 -0700
+Subject: rpmsg: glink: Propagate TX failures in intentless mode as well
+
+From: Bjorn Andersson <quic_bjorande@quicinc.com>
+
+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>
+---
+ drivers/rpmsg/qcom_glink_native.c |   10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/drivers/rpmsg/qcom_glink_native.c
++++ b/drivers/rpmsg/qcom_glink_native.c
+@@ -1355,8 +1355,9 @@ static int __qcom_glink_send(struct glin
+       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 glin
+                                   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;
+               }
+       }
index ec7946f1b8bdf1a99bc7635d367f8ee35135746f..ed2880af9d04a1edf15a51f51e3b58aeeb3a0c66 100644 (file)
@@ -123,3 +123,4 @@ media-wl128x-fix-atomicity-violation-in-fmc_send_cmd.patch
 usb-dwc3-gadget-fix-checking-for-number-of-trbs-left.patch
 lib-string_helpers-silence-snprintf-output-truncation-warning.patch
 nfsd-prevent-a-potential-integer-overflow.patch
+rpmsg-glink-propagate-tx-failures-in-intentless-mode-as-well.patch