mirror of https://gitee.com/openkylin/linux.git
[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>
This commit is contained in:
parent
69bdea7047
commit
07f651c72a
|
@ -794,11 +794,15 @@ static int pxafb_smart_thread(void *arg)
|
||||||
if (try_to_freeze())
|
if (try_to_freeze())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
mutex_lock(&fbi->ctrlr_lock);
|
||||||
|
|
||||||
if (fbi->state == C_ENABLE) {
|
if (fbi->state == C_ENABLE) {
|
||||||
inf->smart_update(&fbi->fb);
|
inf->smart_update(&fbi->fb);
|
||||||
complete(&fbi->refresh_done);
|
complete(&fbi->refresh_done);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_unlock(&fbi->ctrlr_lock);
|
||||||
|
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
set_current_state(TASK_INTERRUPTIBLE);
|
||||||
schedule_timeout(30 * HZ / 1000);
|
schedule_timeout(30 * HZ / 1000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue