aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo/glamo-cmdq.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-04-28 01:34:13 +0100
committerThomas White <taw@bitwiz.org.uk>2009-04-28 01:34:13 +0100
commit92e2326b6766799f04c3bb6f84f06239319717b7 (patch)
tree10a34210069aa585e78d86e51a1fbab49f2490c8 /drivers/mfd/glamo/glamo-cmdq.c
parent99ad96cdb47b5548ec6bf9209c1e1831a974cd7c (diff)
Allow command queue timeout
This allows glamo_cmdq_wait() to timeout. We will probably need to substitute this for something better later on, but for the time being I wanted to avoid a deadlock if the command queue never cleared. Signed-off-by: Thomas White <taw@bitwiz.org.uk>
Diffstat (limited to 'drivers/mfd/glamo/glamo-cmdq.c')
-rw-r--r--drivers/mfd/glamo/glamo-cmdq.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mfd/glamo/glamo-cmdq.c b/drivers/mfd/glamo/glamo-cmdq.c
index 89e88d3c329..58cdcfd5da0 100644
--- a/drivers/mfd/glamo/glamo-cmdq.c
+++ b/drivers/mfd/glamo/glamo-cmdq.c
@@ -81,6 +81,7 @@ static void
glamo_cmdq_wait(struct glamodrm_handle *gdrm, enum glamo_engine engine)
{
u16 mask, val, status;
+ int i;
switch (engine)
{
@@ -108,10 +109,11 @@ glamo_cmdq_wait(struct glamodrm_handle *gdrm, enum glamo_engine engine)
}
printk(KERN_INFO "Waiting for engine idle...\n");
- do {
- status = ioread16(gdrm->reg_base + GLAMO_REG_CMDQ_STATUS);
- } while ((status & mask) != val);
- printk(KERN_INFO "Engine(s) idle.\n");
+ for ( i=0; i<10000; i++ ) {
+ status = reg_read(gdrm, GLAMO_REG_CMDQ_STATUS);
+ if ((status & mask) == val) break;
+ }
+ if ( i == 10000 ) printk(KERN_WARNING "[glamo-drm] CmdQ timeout!\n");
}