[ 3.5.y.z extended stable ] Patch "dmaengine: imx-dma: fix callback path in tasklet" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Fri Oct 11 10:25:09 UTC 2013
This is a note to let you know that I have just added a patch titled
dmaengine: imx-dma: fix callback path in tasklet
to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 733f246cc01e481299fecc3798d06521448d8139 Mon Sep 17 00:00:00 2001
From: Michael Grzeschik <m.grzeschik at pengutronix.de>
Date: Tue, 17 Sep 2013 15:56:08 +0200
Subject: [PATCH] dmaengine: imx-dma: fix callback path in tasklet
commit 6e35f9bd031bcd5cc25f2af83f5bbe483b95c1ac upstream.
We need to free the ld_active list head before jumping into the callback
routine. Otherwise the callback could run into issue_pending and change
our ld_active list head we just going to free. This will run the channel
list into an currupted and undefined state.
Signed-off-by: Michael Grzeschik <m.grzeschik at pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul at intel.com>
Cc: Jonghwan Choi <jhbird.choi at samsung.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/dma/imx-dma.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 2eb396e..39e07e5 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -564,13 +564,11 @@ static void imxdma_tasklet(unsigned long data)
if (list_empty(&imxdmac->ld_active)) {
/* Someone might have called terminate all */
- goto out;
+ spin_unlock_irqrestore(&imxdma->lock, flags);
+ return;
}
desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, node);
- if (desc->desc.callback)
- desc->desc.callback(desc->desc.callback_param);
-
/* If we are dealing with a cyclic descriptor, keep it on ld_active
* and dont mark the descriptor as complete.
* Only in non-cyclic cases it would be marked as complete
@@ -598,6 +596,10 @@ static void imxdma_tasklet(unsigned long data)
}
out:
spin_unlock_irqrestore(&imxdma->lock, flags);
+
+ if (desc->desc.callback)
+ desc->desc.callback(desc->desc.callback_param);
+
}
static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
--
1.8.3.2
More information about the kernel-team
mailing list