summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/dma.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-03-16 16:53:24 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:37:01 -0800
commit3be91d7fe5bc03124046d792e0ecc4713d0e0fed (patch)
treea616388a5ccf15e1a379105fdaa6ed8297124fe2 /arch/arm/mach-tegra/dma.c
parent5d753a83f9d89c3154a40147837109e817f5cee8 (diff)
ARM: tegra: dma: Do not call complete callback on canceled requests
Calling the complete callback when a request is cancelled leads to locking problems in the callback, which could be called from an IRQ with no locks held, or from whatever context called tegra_dma_dequeue_req. Instead, expect the caller to handle the now-cancelled request as needed. Also removes tegra_dma_dequeue, since all users can be trivially converted to tegra_dma_dequeue_req. Change-Id: If699239c09c78d1cd3afa0eaad46535b1d401a24 Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/dma.c')
-rw-r--r--arch/arm/mach-tegra/dma.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c
index 6020871f5ef6..cfe017d1c9cf 100644
--- a/arch/arm/mach-tegra/dma.c
+++ b/arch/arm/mach-tegra/dma.c
@@ -137,24 +137,6 @@ static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch,
struct tegra_dma_req *req);
static void tegra_dma_stop(struct tegra_dma_channel *ch);
-void tegra_dma_flush(struct tegra_dma_channel *ch)
-{
-}
-EXPORT_SYMBOL(tegra_dma_flush);
-
-void tegra_dma_dequeue(struct tegra_dma_channel *ch)
-{
- struct tegra_dma_req *req;
-
- if (tegra_dma_is_empty(ch))
- return;
-
- req = list_entry(ch->list.next, typeof(*req), node);
-
- tegra_dma_dequeue_req(ch, req);
- return;
-}
-
void tegra_dma_stop(struct tegra_dma_channel *ch)
{
u32 csr;
@@ -250,7 +232,7 @@ int tegra_dma_dequeue_req(struct tegra_dma_channel *ch,
}
if (!found) {
spin_unlock_irqrestore(&ch->lock, irq_flags);
- return 0;
+ return -EINVAL;
}
if (!stop)
@@ -286,8 +268,6 @@ skip_status:
spin_unlock_irqrestore(&ch->lock, irq_flags);
- /* Callback should be called without any lock */
- req->complete(req);
return 0;
}
EXPORT_SYMBOL(tegra_dma_dequeue_req);