summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2011-04-01 17:01:38 +0530
committerNitin Kumbhar <nkumbhar@nvidia.com>2011-04-01 17:01:38 +0530
commitcc733bbc1ec1a353750694effa3efb6b58bbee97 (patch)
treefb0f84c9190a55fa8b842c68977f33dbd03a66b2
parent677368f44ce65fe2292f696f0bfd568d3ac78436 (diff)
Revert "ARM: tegra: dma: Do not call complete callback on canceled requests"
This reverts commit b7f9c567e6b95074087584672773a167224608d3. tegra_dma_dequeue() is needed by tegra_hsuart, spi and spi slave.
-rw-r--r--arch/arm/mach-tegra/dma.c22
-rw-r--r--arch/arm/mach-tegra/include/mach/dma.h1
2 files changed, 22 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c
index eb8590f836d1..a80c71819c19 100644
--- a/arch/arm/mach-tegra/dma.c
+++ b/arch/arm/mach-tegra/dma.c
@@ -135,6 +135,24 @@ 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;
@@ -262,7 +280,7 @@ int tegra_dma_dequeue_req(struct tegra_dma_channel *ch,
}
if (!found) {
spin_unlock_irqrestore(&ch->lock, irq_flags);
- return -EINVAL;
+ return 0;
}
if (!stop)
@@ -283,6 +301,8 @@ 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 257367980614..cb0248cca615 100644
--- a/arch/arm/mach-tegra/include/mach/dma.h
+++ b/arch/arm/mach-tegra/include/mach/dma.h
@@ -142,6 +142,7 @@ 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,