summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-03-16 16:53:24 -0700
committerColin Cross <ccross@android.com>2011-03-22 11:25:25 -0700
commitb7f9c567e6b95074087584672773a167224608d3 (patch)
tree9d9e9688bbc1e3b68d7e6b639510fd891e47a6a0 /arch
parent34279b4fb531924e1bd66c364bb2f97c9a578646 (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')
-rw-r--r--arch/arm/mach-tegra/dma.c22
-rw-r--r--arch/arm/mach-tegra/include/mach/dma.h1
2 files changed, 1 insertions, 22 deletions
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c
index db94fcf58399..44f70a9cde7a 100644
--- a/arch/arm/mach-tegra/dma.c
+++ b/arch/arm/mach-tegra/dma.c
@@ -135,24 +135,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;
@@ -248,7 +230,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)
@@ -284,8 +266,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);
diff --git a/arch/arm/mach-tegra/include/mach/dma.h b/arch/arm/mach-tegra/include/mach/dma.h
index d385b7a251be..60b669ae3948 100644
--- a/arch/arm/mach-tegra/include/mach/dma.h
+++ b/arch/arm/mach-tegra/include/mach/dma.h
@@ -142,7 +142,6 @@ int tegra_dma_enqueue_req(struct tegra_dma_channel *ch,
struct tegra_dma_req *req);
int tegra_dma_dequeue_req(struct tegra_dma_channel *ch,
struct tegra_dma_req *req);
-void tegra_dma_dequeue(struct tegra_dma_channel *ch);
void tegra_dma_flush(struct tegra_dma_channel *ch);
bool tegra_dma_is_req_inflight(struct tegra_dma_channel *ch,