summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0078-beaglebone-error-handling-for-DMA-completion-in-cssp.patch
blob: cc678ba9f1fa1913ee20104c2d22259f1c531bc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 823d8b7b4a1dcfefc7260110a3acada0d1f45695 Mon Sep 17 00:00:00 2001
From: Dan Aizenstros <daizenstros@quicklogic.com>
Date: Thu, 12 Jul 2012 16:52:21 -0400
Subject: [PATCH 78/79] beaglebone: error handling for DMA completion in
 cssp_camera.c

Signed-off-by: Dan Aizenstros <daizenstros@quicklogic.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 drivers/media/video/cssp_camera/cssp_camera.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/media/video/cssp_camera/cssp_camera.c b/drivers/media/video/cssp_camera/cssp_camera.c
index acd38ee..fca199b 100644
--- a/drivers/media/video/cssp_camera/cssp_camera.c
+++ b/drivers/media/video/cssp_camera/cssp_camera.c
@@ -191,6 +191,21 @@ static void dma_callback(unsigned lch, u16 ch_status, void *data)
 	if (ch_status == DMA_COMPLETE) {
 		struct vb2_buffer *vb = dev->current_vb;
 		struct timeval ts;
+		struct edmacc_param dma_tr_params;
+
+		edma_read_slot(dev->dma_ch, &dma_tr_params);
+		if ((dma_tr_params.opt != 0) ||
+			(dma_tr_params.src != 0) ||
+			(dma_tr_params.a_b_cnt != 0) ||
+			(dma_tr_params.dst != 0) ||
+			(dma_tr_params.src_dst_bidx != 0) ||
+			(dma_tr_params.link_bcntrld != 0xffff) ||
+			(dma_tr_params.src_dst_cidx != 0) ||
+			(dma_tr_params.ccnt != 0)) {
+
+			trigger_dma_transfer_to_buf(dev, dev->current_vb);
+			return;
+		}
 
 		vb->v4l2_buf.field = dev->field;
 		dev->field_count++;
@@ -204,7 +219,6 @@ static void dma_callback(unsigned lch, u16 ch_status, void *data)
 		/* check if we have new buffer queued */
 		dequeue_buffer_for_dma(dev);
 	} else {
-		printk(KERN_ERR "[cssp_camera]: EDMA error (ch_status = %d)\n", ch_status);
 		/* we got a missed interrupt so just start a new DMA with the existing buffer */
 		if (dev->current_vb != NULL)
 			trigger_dma_transfer_to_buf(dev, dev->current_vb);
-- 
1.7.10