aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-11-08 18:53:16 +0100
committerThomas White <taw@bitwiz.org.uk>2009-11-08 18:53:16 +0100
commitcbd833973d74a12c6f07ed5174bf0e1b0f365da2 (patch)
tree2e93c741f8ced0a747585b19e874ce10926cd9d4
parent7db029c37f7fae82b96e94b94c8a4a9b14704f96 (diff)
Fix some CmdQ nonsense (?)
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
-rw-r--r--drivers/mfd/glamo/glamo-cmdq.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/mfd/glamo/glamo-cmdq.c b/drivers/mfd/glamo/glamo-cmdq.c
index f7bb0be678e..215017d86ba 100644
--- a/drivers/mfd/glamo/glamo-cmdq.c
+++ b/drivers/mfd/glamo/glamo-cmdq.c
@@ -125,6 +125,11 @@ static int glamo_add_to_ring(struct glamodrm_handle *gdrm, u16 *addr,
size_t ring_write, ring_read;
size_t new_ring_write;
+ if ( count >= GLAMO_CMDQ_SIZE ) {
+ printk(KERN_WARNING "[glamo-drm] CmdQ submission too large\n");
+ return -EINVAL;
+ }
+
down(&gdrm->add_to_ring);
ring_write = glamo_get_write(gdrm);
@@ -170,16 +175,6 @@ static int glamo_add_to_ring(struct glamodrm_handle *gdrm, u16 *addr,
new_ring_write = 4;
}
- /* Suppose we just filled the WHOLE ring buffer, and so the
- * write position ends up in the same place as it started.
- * No change in poginter means no activity from the command
- * queue engine. So, insert a no-op */
- if (ring_write == new_ring_write) {
- iowrite16(0x0000, gdrm->cmdq_base + new_ring_write);
- iowrite16(0x0000, gdrm->cmdq_base + new_ring_write + 2);
- new_ring_write += 4;
- }
-
} else {
memcpy_toio(gdrm->cmdq_base+ring_write, addr, count);