Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-12 22:18:26 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-12 22:21:21 +0100
commit3a0a1ca67860639c423910f5bcd16f0747bdab3a (patch)
tree1964e8ae81a348189f55abfdf6aa857ae7d892be
parent6cebf8eea2534dfdf36ef6613c7623fca4cfd0d3 (diff)
dmaengine: imx-dma: fix wrong callback invoke (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.8-318-dmaengine-imx-dma-fix-wrong-callback-invoke.patch69
-rw-r--r--series.conf1
2 files changed, 70 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.8-318-dmaengine-imx-dma-fix-wrong-callback-invoke.patch b/patches.kernel.org/4.20.8-318-dmaengine-imx-dma-fix-wrong-callback-invoke.patch
new file mode 100644
index 0000000000..58a5741dda
--- /dev/null
+++ b/patches.kernel.org/4.20.8-318-dmaengine-imx-dma-fix-wrong-callback-invoke.patch
@@ -0,0 +1,69 @@
+From: Leonid Iziumtsev <leonid.iziumtsev@gmail.com>
+Date: Tue, 15 Jan 2019 17:15:23 +0000
+Subject: [PATCH] dmaengine: imx-dma: fix wrong callback invoke
+References: bnc#1012628
+Patch-mainline: 4.20.8
+Git-commit: 341198eda723c8c1cddbb006a89ad9e362502ea2
+
+commit 341198eda723c8c1cddbb006a89ad9e362502ea2 upstream.
+
+Once the "ld_queue" list is not empty, next descriptor will migrate
+into "ld_active" list. The "desc" variable will be overwritten
+during that transition. And later the dmaengine_desc_get_callback_invoke()
+will use it as an argument. As result we invoke wrong callback.
+
+That behaviour was in place since:
+commit fcaaba6c7136 ("dmaengine: imx-dma: fix callback path in tasklet").
+But after commit 4cd13c21b207 ("softirq: Let ksoftirqd do its job")
+things got worse, since possible delay between tasklet_schedule()
+from DMA irq handler and actual tasklet function execution got bigger.
+And that gave more time for new DMA request to be submitted and
+to be put into "ld_queue" list.
+
+It has been noticed that DMA issue is causing problems for "mxc-mmc"
+driver. While stressing the system with heavy network traffic and
+writing/reading to/from sd card simultaneously the timeout may happen:
+
+10013000.sdhci: mxcmci_watchdog: read time out (status = 0x30004900)
+
+That often lead to file system corruption.
+
+Signed-off-by: Leonid Iziumtsev <leonid.iziumtsev@gmail.com>
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/dma/imx-dma.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
+index c2fff3f6c9ca..4a09af3cd546 100644
+--- a/drivers/dma/imx-dma.c
++++ b/drivers/dma/imx-dma.c
+@@ -618,7 +618,7 @@ static void imxdma_tasklet(unsigned long data)
+ {
+ struct imxdma_channel *imxdmac = (void *)data;
+ struct imxdma_engine *imxdma = imxdmac->imxdma;
+- struct imxdma_desc *desc;
++ struct imxdma_desc *desc, *next_desc;
+ unsigned long flags;
+
+ spin_lock_irqsave(&imxdma->lock, flags);
+@@ -648,10 +648,10 @@ static void imxdma_tasklet(unsigned long data)
+ list_move_tail(imxdmac->ld_active.next, &imxdmac->ld_free);
+
+ if (!list_empty(&imxdmac->ld_queue)) {
+- desc = list_first_entry(&imxdmac->ld_queue, struct imxdma_desc,
+- node);
++ next_desc = list_first_entry(&imxdmac->ld_queue,
++ struct imxdma_desc, node);
+ list_move_tail(imxdmac->ld_queue.next, &imxdmac->ld_active);
+- if (imxdma_xfer_desc(desc) < 0)
++ if (imxdma_xfer_desc(next_desc) < 0)
+ dev_warn(imxdma->dev, "%s: channel: %d couldn't xfer desc\n",
+ __func__, imxdmac->channel);
+ }
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index cbc34d73a0..eb46de5d66 100644
--- a/series.conf
+++ b/series.conf
@@ -1054,6 +1054,7 @@
patches.kernel.org/4.20.8-315-HID-debug-fix-the-ring-buffer-implementation.patch
patches.kernel.org/4.20.8-316-dmaengine-bcm2835-Fix-interrupt-race-on-RT.patch
patches.kernel.org/4.20.8-317-dmaengine-bcm2835-Fix-abort-of-transactions.patch
+ patches.kernel.org/4.20.8-318-dmaengine-imx-dma-fix-wrong-callback-invoke.patch
########################################################
# Build fixes that apply to the vanilla kernel too.