aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/pxafb.c
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2008-12-08 05:51:01 -0500
committerEric Miao <eric.miao@marvell.com>2008-12-17 09:51:04 -0500
commit07f651c72ac0530033883c113939d9b9c7fa75e5 (patch)
tree955308697de170af5809b8be4552ea6d05fabeef /drivers/video/pxafb.c
parent69bdea7047fbac88beb8b7ba9e428c4f0e53f563 (diff)
[ARM] pxafb: avoid the racing condition in pxafb_smart_thread
fbi->state change shall really be protected by fbi->ctrlr_lock, where the change is sheltered. There is a possibility that pxafb_smart_thread will start update the LCD panel when fbi->state == C_ENABLE, while all other initialization isn't done. Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'drivers/video/pxafb.c')
-rw-r--r--drivers/video/pxafb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 1e1c4ec0d3b9..ab689597f259 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -794,11 +794,15 @@ static int pxafb_smart_thread(void *arg)
794 if (try_to_freeze()) 794 if (try_to_freeze())
795 continue; 795 continue;
796 796
797 mutex_lock(&fbi->ctrlr_lock);
798
797 if (fbi->state == C_ENABLE) { 799 if (fbi->state == C_ENABLE) {
798 inf->smart_update(&fbi->fb); 800 inf->smart_update(&fbi->fb);
799 complete(&fbi->refresh_done); 801 complete(&fbi->refresh_done);
800 } 802 }
801 803
804 mutex_unlock(&fbi->ctrlr_lock);
805
802 set_current_state(TASK_INTERRUPTIBLE); 806 set_current_state(TASK_INTERRUPTIBLE);
803 schedule_timeout(30 * HZ / 1000); 807 schedule_timeout(30 * HZ / 1000);
804 } 808 }