summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Jiejing <jiejing.zhang@freescale.com>2012-03-06 14:47:57 +0800
committerZhang Jiejing <jiejing.zhang@freescale.com>2012-03-09 00:10:46 +0800
commita88e7a1c39bbbf56f0f7fe0fbd6df84bd9a55522 (patch)
tree9b4f96e0b56364f0e309fe3f47ca85cfbe179f65
parent8fdc1d60ec595765f9fcd03e1ed2f7dab000766f (diff)
ENGR00176159 video: ipuv3-fb: change to timeout semaphore to wait on irq.
change to timeout semaphore to wait on irq. use no timeout semaphore have below issues: 1. since fbmem.c will hold the console_lock() before call PAN_DISPLAY ioictl, if have wrong happens on IPU, IRQ not come, any log printk will not ouput, it will become like a system hang, and developer don't know what's wrong. 2. semaphore don't have timeout, here we can't know irq not come, so hang it infintly. 3. semaphore lock and unlock in different context is a dangous operation. To fix these issue, use timedout version to wait on irq. But for better coding stly to align Kernel Coding Style Doc, better use complete to wait on irq, use semaphre little ugly. Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
-rw-r--r--drivers/video/mxc/mxc_ipuv3_fb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/video/mxc/mxc_ipuv3_fb.c b/drivers/video/mxc/mxc_ipuv3_fb.c
index 8c45a534cbfb..16913a71376d 100644
--- a/drivers/video/mxc/mxc_ipuv3_fb.c
+++ b/drivers/video/mxc/mxc_ipuv3_fb.c
@@ -926,7 +926,11 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
else
ipu_alp_ch_irq = IPU_IRQ_BG_ALPHA_SYNC_EOF;
- down(&mxc_fbi->alpha_flip_sem);
+ if (down_timeout(&mxc_fbi->alpha_flip_sem, HZ/2)) {
+ dev_err(fbi->device, "timeout when waitting for alpha flip irq\n");
+ retval = -ETIMEDOUT;
+ break;
+ }
mxc_fbi->cur_ipu_alpha_buf =
!mxc_fbi->cur_ipu_alpha_buf;
@@ -1318,7 +1322,10 @@ mxcfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
}
}
- down(&mxc_fbi->flip_sem);
+ if (down_timeout(&mxc_fbi->flip_sem, HZ/2)) {
+ dev_err(info->device, "timeout when waitting for flip irq\n");
+ return -ETIMEDOUT;
+ }
mxc_fbi->cur_ipu_buf = (++mxc_fbi->cur_ipu_buf) % 3;
mxc_fbi->cur_ipu_alpha_buf = !mxc_fbi->cur_ipu_alpha_buf;