From 4d257b46d5759c3c0036ace82ba447536229a883 Mon Sep 17 00:00:00 2001 From: Inki Dae Date: Tue, 24 Apr 2018 15:09:19 +0900 Subject: [PATCH] drm/tgm: fix deadlock issue Fixed a deadlock issue on mem_lock of tdm pp driver. The deadlock could happen when pp_start_property function is called at the funciton which already taken a mem_lock because pp_start_property takes the mem_lock internally so this patch makes the mem_lock to be unlocked before pp_start_property funciton is called. Change-Id: Icde3999a978252c00d845fd0a954cf5d3298397a Signed-off-by: Inki Dae --- drivers/gpu/drm/tgm/tdm_pp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tgm/tdm_pp.c b/drivers/gpu/drm/tgm/tdm_pp.c index 2b17d97de61..d89af02d559 100644 --- a/drivers/gpu/drm/tgm/tdm_pp.c +++ b/drivers/gpu/drm/tgm/tdm_pp.c @@ -954,6 +954,7 @@ static int pp_queue_buf_with_run(struct device *dev, cmd_work->ctrl = PP_CTRL_PLAY; pp_handle_cmd_work(dev, ppdrv, cmd_work, c_node); } else { + mutex_unlock(&c_node->mem_lock); mutex_lock(&ppdrv->drv_lock); ret = pp_start_property(ppdrv, c_node); @@ -964,6 +965,7 @@ static int pp_queue_buf_with_run(struct device *dev, } mutex_unlock(&ppdrv->drv_lock); + mutex_lock(&c_node->mem_lock); } } else { ret = pp_set_mem_node(ppdrv, c_node, m_node); -- 2.34.1