From 0331bcf0febc8d7fca6329b19bb8e4a2016137cc Mon Sep 17 00:00:00 2001 From: Srihitha Tangudu Date: Mon, 6 Feb 2023 19:21:56 +0530 Subject: [PATCH] disp: msm: dsi: avoid taking ctrl lock while waiting for CMD DMA done Currently, ctrl lock is taken while waiting for CMD DMA done even in case of ASYNC command transfer, which doesn't allow any other operation on the controller until the command transfer is done. Avoid this by not taking ctrl lock while waiting for CMD DMA done. Change-Id: I91f2638fa02f48ec4c7a41c750daa46b52c5e2f2 Signed-off-by: Srihitha Tangudu --- msm/dsi/dsi_ctrl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/msm/dsi/dsi_ctrl.c b/msm/dsi/dsi_ctrl.c index 2cb3950bca..6a5c542af2 100644 --- a/msm/dsi/dsi_ctrl.c +++ b/msm/dsi/dsi_ctrl.c @@ -419,20 +419,21 @@ static void dsi_ctrl_clear_dma_status(struct dsi_ctrl *dsi_ctrl) dsi_hw_ops = dsi_ctrl->hw.ops; + mutex_lock(&dsi_ctrl->ctrl_lock); + status = dsi_hw_ops.poll_dma_status(&dsi_ctrl->hw); SDE_EVT32(dsi_ctrl->cell_index, SDE_EVTLOG_FUNC_ENTRY, status); status |= (DSI_CMD_MODE_DMA_DONE | DSI_BTA_DONE); dsi_hw_ops.clear_interrupt_status(&dsi_ctrl->hw, status); + mutex_unlock(&dsi_ctrl->ctrl_lock); } static void dsi_ctrl_post_cmd_transfer(struct dsi_ctrl *dsi_ctrl) { struct dsi_ctrl_hw_ops dsi_hw_ops = dsi_ctrl->hw.ops; - mutex_lock(&dsi_ctrl->ctrl_lock); - SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY, dsi_ctrl->cell_index, dsi_ctrl->pending_cmd_flags); /* In case of broadcast messages, we poll on the slave controller. */ @@ -444,6 +445,8 @@ static void dsi_ctrl_post_cmd_transfer(struct dsi_ctrl *dsi_ctrl) dsi_ctrl_dma_cmd_wait_for_done(dsi_ctrl); } + mutex_lock(&dsi_ctrl->ctrl_lock); + if (dsi_ctrl->hw.reset_trig_ctrl) dsi_hw_ops.reset_trig_ctrl(&dsi_ctrl->hw, &dsi_ctrl->host_config.common_config);