From 30399c1f96f2e281eb70729ac7dcefdb5d1abc90 Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Thu, 18 Apr 2019 16:34:05 +0800 Subject: [PATCH] MLK-21489 drm/imx: dpu: kms: Return properly in case we fail to get plane state to check We should return properly in case we fail to get plane state to check. For example, a race condition on the plane state would happen when one thread does page flip and another thread updates CRTC properties on that CRTC simultaneously. '-EDEADLK' should be returned when the condition occurs. Signed-off-by: Liu Ying (cherry picked from commit 2ab36051b74c49f66bb12d8d8086e6e6b3dc069b) --- drivers/gpu/drm/imx/dpu/dpu-kms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/imx/dpu/dpu-kms.c b/drivers/gpu/drm/imx/dpu/dpu-kms.c index 485ff9620670..07e68bc34dcc 100644 --- a/drivers/gpu/drm/imx/dpu/dpu-kms.c +++ b/drivers/gpu/drm/imx/dpu/dpu-kms.c @@ -604,6 +604,9 @@ static int dpu_drm_atomic_check(struct drm_device *dev, drm_for_each_plane_mask(plane, dev, crtc_state->plane_mask) { plane_state = drm_atomic_get_plane_state(state, plane); + if (IS_ERR(plane_state)) + return PTR_ERR(plane_state); + dpstate = to_dpu_plane_state(plane_state); fb = plane_state->fb; dpu_plane = to_dpu_plane(plane); -- 2.17.1