MLK-20223 video: epdc: Increase the time available for LUT cleanup
authorBogdan Chircu <bogdan-petru.chircu-mare@nxp.com>
Tue, 27 Nov 2018 21:13:19 +0000 (13:13 -0800)
committerRobby Cai <robby.cai@nxp.com>
Sun, 28 Apr 2019 09:22:46 +0000 (17:22 +0800)
The problem is that the kthread from submit workqueue aquires the queue_mutex
and blocks the kthread from interrupt workqueue. But the kthread from interrupt
workqueue is the one that should update the used_luts variable (on which the
kthread from submit workqueue keeps polling), but it doesn't have a chance to
do it (because it is blocked by mutex), even if the LUT complete interrupts are
triggered. So the fix is, after the polling to release the mutex so that the
kthread from interrupt workqueue can process the LUT complete interrupts and
update the used_luts variable accordingly.

Signed-off-by: Bogdan Chircu <bogdan-petru.chircu-mare@nxp.com>
Signed-off-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit bcaea8983ca3864bc5df5dc90b49ffe2d0fadf29)

drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c

index 6274b58..91338b5 100644 (file)
@@ -1054,6 +1054,9 @@ static int epdc_choose_next_lut(struct mxc_epdc_fb_data *fb_data, int *next_lut)
                pxp_clear_wb_work_func(fb_data);
                used_luts &= ~luts_complete;
                fb_data->luts_complete &= ~luts_complete;
+               mutex_unlock(&fb_data->queue_mutex);
+               msleep(10);
+               mutex_lock(&fb_data->queue_mutex);
        }
 
        used_luts |= 0x1;