diff options
author | Steven Toth <stoth@kernellabs.com> | 2010-07-31 13:47:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-21 05:54:37 -0400 |
commit | 4a52be0faa014380b7bf15c5ca7e3dea7cb4ea52 (patch) | |
tree | e39d8b9a822877a7ab7048e9cc55dd6f6f522ce1 /drivers/media/video/saa7164/saa7164-cmd.c | |
parent | 91d80189fab8c473a392d81b6834b8032191c990 (diff) |
[media] saa7164: command dequeue fixup to clean the bus after error
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164/saa7164-cmd.c')
-rw-r--r-- | drivers/media/video/saa7164/saa7164-cmd.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/media/video/saa7164/saa7164-cmd.c b/drivers/media/video/saa7164/saa7164-cmd.c index f33c0b533841..e4ec44f5c7cc 100644 --- a/drivers/media/video/saa7164/saa7164-cmd.c +++ b/drivers/media/video/saa7164/saa7164-cmd.c | |||
@@ -82,9 +82,10 @@ u32 saa7164_cmd_timeout_get(struct saa7164_dev *dev, u8 seqno) | |||
82 | * -bus/c running buffer. */ | 82 | * -bus/c running buffer. */ |
83 | int saa7164_irq_dequeue(struct saa7164_dev *dev) | 83 | int saa7164_irq_dequeue(struct saa7164_dev *dev) |
84 | { | 84 | { |
85 | int ret = SAA_OK; | 85 | int ret = SAA_OK, i = 0; |
86 | u32 timeout; | 86 | u32 timeout; |
87 | wait_queue_head_t *q = 0; | 87 | wait_queue_head_t *q = 0; |
88 | u8 tmp[512]; | ||
88 | dprintk(DBGLVL_CMD, "%s()\n", __func__); | 89 | dprintk(DBGLVL_CMD, "%s()\n", __func__); |
89 | 90 | ||
90 | /* While any outstand message on the bus exists... */ | 91 | /* While any outstand message on the bus exists... */ |
@@ -109,8 +110,22 @@ int saa7164_irq_dequeue(struct saa7164_dev *dev) | |||
109 | printk(KERN_ERR | 110 | printk(KERN_ERR |
110 | "%s() found timed out command on the bus\n", | 111 | "%s() found timed out command on the bus\n", |
111 | __func__); | 112 | __func__); |
113 | |||
114 | /* Clean the bus */ | ||
115 | ret = saa7164_bus_get(dev, &tRsp, &tmp, 0); | ||
116 | printk(KERN_ERR "%s() ret = %x\n", __func__, ret); | ||
117 | if (ret == SAA_ERR_EMPTY) | ||
118 | /* Someone else already fetched the response */ | ||
119 | return SAA_OK; | ||
120 | |||
121 | if (ret != SAA_OK) | ||
122 | return ret; | ||
112 | } | 123 | } |
113 | } while (0); | 124 | |
125 | /* It's unlikely to have more than 4 or 5 pending messages, ensure we exit | ||
126 | * at some point regardles. | ||
127 | */ | ||
128 | } while (i++ < 32); | ||
114 | 129 | ||
115 | return ret; | 130 | return ret; |
116 | } | 131 | } |