disp: msm: dsi: flush workers during pre-release
Wait for asynchronous DSI DCS command transfers to complete before disabling DSI interrupts during pre-release. This is required to resolve a race condition where dsi worker threads can trigger HW access while a VM lend/release is occurring on the CRTC commit thread. Change-Id: Ia1f153a2cd008c617dba274473e7678b01a38d29 Signed-off-by: Steve Cohen <cohens@codeaurora.org>
This commit is contained in:
@@ -5419,6 +5419,7 @@ static int dsi_display_get_io_resources(struct msm_io_res *io_res, void *data)
|
|||||||
static int dsi_display_pre_release(void *data)
|
static int dsi_display_pre_release(void *data)
|
||||||
{
|
{
|
||||||
struct dsi_display *display;
|
struct dsi_display *display;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -5428,6 +5429,17 @@ static int dsi_display_pre_release(void *data)
|
|||||||
display->hw_ownership = false;
|
display->hw_ownership = false;
|
||||||
mutex_unlock(&display->display_lock);
|
mutex_unlock(&display->display_lock);
|
||||||
|
|
||||||
|
/* flush work queues */
|
||||||
|
display_for_each_ctrl(i, display) {
|
||||||
|
struct dsi_display_ctrl *ctrl = &display->ctrl[i];
|
||||||
|
|
||||||
|
if (!ctrl->ctrl || !(ctrl->ctrl->post_tx_queued))
|
||||||
|
continue;
|
||||||
|
flush_workqueue(display->post_cmd_tx_workq);
|
||||||
|
cancel_work_sync(&ctrl->ctrl->post_cmd_tx_work);
|
||||||
|
ctrl->ctrl->post_tx_queued = false;
|
||||||
|
}
|
||||||
|
|
||||||
dsi_display_ctrl_irq_update(display, false);
|
dsi_display_ctrl_irq_update(display, false);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user