]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dmaengine: imx-dma: fix wrong callback invoke
authorLeonid Iziumtsev <leonid.iziumtsev@gmail.com>
Tue, 15 Jan 2019 17:15:23 +0000 (17:15 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 2 May 2019 20:41:35 +0000 (21:41 +0100)
commit41602895d1302a23419d689476f863e4da8778f0
treec9d534d3a2d9d300089c41ea28e4c5c5d14ac1aa
parent103d1a1c453c51d3c8cb0e7cba9ed40a5410b765
dmaengine: imx-dma: fix wrong callback invoke

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/dma/imx-dma.c