From: Liu Ying Date: Thu, 18 Apr 2019 08:34:05 +0000 (+0800) Subject: MLK-21489 drm/imx: dpu: kms: Return properly in case we fail to get plane state to... X-Git-Tag: rel_imx_4.19.35_1.1.0~713 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=30399c1f96f2e281eb70729ac7dcefdb5d1abc90;p=linux.git 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) --- 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);