]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.12-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Aug 2025 15:41:06 +0000 (17:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Aug 2025 15:41:06 +0000 (17:41 +0200)
added patches:
fpga-zynq_fpga-fix-the-wrong-usage-of-dma_map_sgtable.patch

queue-6.12/fpga-zynq_fpga-fix-the-wrong-usage-of-dma_map_sgtable.patch [new file with mode: 0644]
queue-6.12/series

diff --git a/queue-6.12/fpga-zynq_fpga-fix-the-wrong-usage-of-dma_map_sgtable.patch b/queue-6.12/fpga-zynq_fpga-fix-the-wrong-usage-of-dma_map_sgtable.patch
new file mode 100644 (file)
index 0000000..f0821be
--- /dev/null
@@ -0,0 +1,44 @@
+From 1ca61060de92a4320d73adfe5dc8d335653907ac Mon Sep 17 00:00:00 2001
+From: Xu Yilun <yilun.xu@linux.intel.com>
+Date: Wed, 6 Aug 2025 15:06:05 +0800
+Subject: fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable()
+
+From: Xu Yilun <yilun.xu@linux.intel.com>
+
+commit 1ca61060de92a4320d73adfe5dc8d335653907ac upstream.
+
+dma_map_sgtable() returns only 0 or the error code. Read sgt->nents to
+get the number of mapped segments.
+
+Fixes: 37e00703228a ("zynq_fpga: use sgtable-based scatterlist wrappers")
+Reported-by: Pavel Pisa <pisa@fel.cvut.cz>
+Closes: https://lore.kernel.org/linux-fpga/202508041548.22955.pisa@fel.cvut.cz/
+Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
+Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
+Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
+Tested-by: Pavel Pisa <pisa@fel.cvut.cz>
+Link: https://lore.kernel.org/r/20250806070605.1920909-2-yilun.xu@linux.intel.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/fpga/zynq-fpga.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/fpga/zynq-fpga.c
++++ b/drivers/fpga/zynq-fpga.c
+@@ -405,12 +405,12 @@ static int zynq_fpga_ops_write(struct fp
+               }
+       }
+-      priv->dma_nelms =
+-          dma_map_sgtable(mgr->dev.parent, sgt, DMA_TO_DEVICE, 0);
+-      if (priv->dma_nelms == 0) {
++      err = dma_map_sgtable(mgr->dev.parent, sgt, DMA_TO_DEVICE, 0);
++      if (err) {
+               dev_err(&mgr->dev, "Unable to DMA map (TO_DEVICE)\n");
+-              return -ENOMEM;
++              return err;
+       }
++      priv->dma_nelms = sgt->nents;
+       /* enable clock */
+       err = clk_enable(priv->clk);
index 05dc35f029e2c472ae64c0fd9ac1a268f2c20134..dd79b31113eb515174ef30ccb5eef3d6f4504332 100644 (file)
@@ -211,3 +211,4 @@ cpuidle-menu-remove-iowait-influence.patch
 cpuidle-governors-menu-avoid-selecting-states-with-too-much-latency.patch
 drm-dp-change-aux-dpcd-probe-address-from-dpcd_rev-to-lane0_1_status.patch
 mmc-sdhci_am654-disable-hs400-for-am62p-sr1.0-and-sr1.1.patch
+fpga-zynq_fpga-fix-the-wrong-usage-of-dma_map_sgtable.patch