summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-omap-pm-2.6.29/dss2/0054-DSS2-DSI-more-error-handling.patch
blob: 5f4f155452d1692647e0705004b1967604240475 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
From 3b27a3c4f6b84e46c84509f610dfe1456c0d72d3 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Mon, 27 Apr 2009 11:06:16 +0300
Subject: [PATCH 54/69] DSS2: DSI: more error handling

---
 drivers/video/omap2/dss/dsi.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index d59ad38..d8df353 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -289,6 +289,8 @@ static struct
 
 	bool autoupdate_setup;
 
+	u32		errors;
+	spinlock_t	errors_lock;
 #ifdef DEBUG
 	ktime_t perf_setup_time;
 	ktime_t perf_start_time;
@@ -541,6 +543,9 @@ void dsi_irq_handler(void)
 	if (irqstatus & DSI_IRQ_ERROR_MASK) {
 		DSSERR("DSI error, irqstatus %x\n", irqstatus);
 		print_irq_status(irqstatus);
+		spin_lock(&dsi.errors_lock);
+		dsi.errors |= irqstatus & DSI_IRQ_ERROR_MASK;
+		spin_unlock(&dsi.errors_lock);
 	} else if (debug_irq) {
 		print_irq_status(irqstatus);
 	}
@@ -616,6 +621,17 @@ static void _dsi_initialize_irq(void)
 			-1 & (~DSI_CIO_IRQ_ERRCONTROL2));
 }
 
+static u32 dsi_get_errors(void)
+{
+	unsigned long flags;
+	u32 e;
+	spin_lock_irqsave(&dsi.errors_lock, flags);
+	e = dsi.errors;
+	dsi.errors = 0;
+	spin_unlock_irqrestore(&dsi.errors_lock, flags);
+	return e;
+}
+
 static void dsi_vc_enable_bta_irq(int channel)
 {
 	u32 l;
@@ -1807,6 +1823,7 @@ static int dsi_vc_send_bta(int channel)
 static int dsi_vc_send_bta_sync(int channel)
 {
 	int r = 0;
+	u32 err;
 
 	init_completion(&dsi.bta_completion);
 
@@ -1822,6 +1839,13 @@ static int dsi_vc_send_bta_sync(int channel)
 		r = -EIO;
 		goto err;
 	}
+
+	err = dsi_get_errors();
+	if (err) {
+		DSSERR("Error while sending BTA: %x\n", err);
+		r = -EIO;
+		goto err;
+	}
 err:
 	dsi_vc_disable_bta_irq(channel);
 
@@ -3720,6 +3744,9 @@ int dsi_init(void)
 {
 	u32 rev;
 
+	spin_lock_init(&dsi.errors_lock);
+	dsi.errors = 0;
+
 	spin_lock_init(&dsi.cmd_lock);
 	dsi.cmd_fifo = kfifo_alloc(
 			DSI_CMD_FIFO_LEN * sizeof(struct dsi_cmd_item),
-- 
1.6.2.4