From 92e2326b6766799f04c3bb6f84f06239319717b7 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 28 Apr 2009 01:34:13 +0100 Subject: 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 --- drivers/mfd/glamo/glamo-cmdq.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/mfd/glamo/glamo-cmdq.c') 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"); } -- cgit v1.2.3