aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:11:08 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:11:08 +0000
commitcd21081b281a4bfc00a5a41280bda734d2139f65 (patch)
tree4af990fce3dedea03e8619af8665fa9b2679aef3 /drivers/mfd
parent1826972ef0e9d1b413d90b42dbcaa617eabf6220 (diff)
fix-glamofb-defuse-yield-bomb-in-atomic-context.patch
If we ever fall through to the yield when we turned off interrupts... it wouldn't be pretty. Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/glamo/glamo-fb.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c
index 62b79f30d66..b886c4e693b 100644
--- a/drivers/mfd/glamo/glamo-fb.c
+++ b/drivers/mfd/glamo/glamo-fb.c
@@ -629,14 +629,14 @@ static inline int glamofb_cmdq_empty(struct glamofb_handle *gfb)
/* call holding gfb->lock_cmd when locking, until you unlock */
int glamofb_cmd_mode(struct glamofb_handle *gfb, int on)
{
- int timeout = 200000;
+ int timeout = 2000000;
dev_dbg(gfb->dev, "glamofb_cmd_mode(gfb=%p, on=%d)\n", gfb, on);
if (on) {
dev_dbg(gfb->dev, "%s: waiting for cmdq empty: ",
__FUNCTION__);
while ((!glamofb_cmdq_empty(gfb)) && (timeout--))
- yield();
+ /* yield() */;
if (timeout < 0) {
printk(KERN_ERR"*************"
"glamofb cmd_queue never got empty"
@@ -650,21 +650,23 @@ int glamofb_cmd_mode(struct glamofb_handle *gfb, int on)
GLAMO_LCD_CMD_TYPE_DISP |
GLAMO_LCD_CMD_DATA_FIRE_VSYNC);
- /* wait until LCD is idle */
- dev_dbg(gfb->dev, "waiting for LCD idle: ");
- timeout = 200000;
+ /* wait until lcd idle */
+ dev_dbg(gfb->dev, "waiting for lcd idle: ");
+ timeout = 2000000;
while ((!reg_read(gfb, GLAMO_REG_LCD_STATUS2) & (1 << 12)) &&
(timeout--))
- yield();
+ /* yield() */;
if (timeout < 0) {
printk(KERN_ERR"*************"
"glamofb lcd never idle"
"*************\n");
return -EIO;
}
- dev_dbg(gfb->dev, "idle!\n");
mdelay(100);
+
+ dev_dbg(gfb->dev, "cmd mode entered\n");
+
} else {
/* RGB interface needs vsync/hsync */
if (reg_read(gfb, GLAMO_REG_LCD_MODE3) & GLAMO_LCD_MODE3_RGB)
@@ -681,6 +683,7 @@ int glamofb_cmd_mode(struct glamofb_handle *gfb, int on)
}
EXPORT_SYMBOL_GPL(glamofb_cmd_mode);
+
int glamofb_cmd_write(struct glamofb_handle *gfb, u_int16_t val)
{
int timeout = 200000;