From: Inki Dae Date: Tue, 24 Apr 2018 06:09:19 +0000 (+0900) Subject: drm/tgm: fix deadlock issue X-Git-Tag: submit/tizen/20180424.080322^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d257b46d5759c3c0036ace82ba447536229a883;p=profile%2Fwearable%2Fplatform%2Fkernel%2Flinux-3.18-exynos7270.git 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 --- 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);