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>
Этот коммит содержится в:
Steve Cohen
2021-10-07 02:35:04 -04:00
родитель 629228c353
Коммит bd01b504a5

Просмотреть файл

@@ -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)
{
struct dsi_display *display;
int i;
if (!data)
return -EINVAL;
@@ -5428,6 +5429,17 @@ static int dsi_display_pre_release(void *data)
display->hw_ownership = false;
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);
return 0;