drm/imx: ipuv3-plane: add IDMAC timeout warning
authorPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 24 Feb 2017 17:38:08 +0000 (18:38 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Mon, 5 Nov 2018 13:56:04 +0000 (14:56 +0100)
ipu_plane_disable should never be called while the plane IDMAC channel
is active. The busy wait is just a safety net that should never time
out.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/drm/imx/ipuv3-plane.c

index 9db833b6881327ab32a4e4366e5ec24bf50fa0bb..c390924de93d978d3acb4200c846fe6b53f753c8 100644 (file)
@@ -228,9 +228,15 @@ static void ipu_plane_enable(struct ipu_plane *ipu_plane)
 
 void ipu_plane_disable(struct ipu_plane *ipu_plane, bool disable_dp_channel)
 {
+       int ret;
+
        DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
-       ipu_idmac_wait_busy(ipu_plane->ipu_ch, 50);
+       ret = ipu_idmac_wait_busy(ipu_plane->ipu_ch, 50);
+       if (ret == -ETIMEDOUT) {
+               DRM_ERROR("[PLANE:%d] IDMAC timeout\n",
+                         ipu_plane->base.base.id);
+       }
 
        if (ipu_plane->dp && disable_dp_channel)
                ipu_dp_disable_channel(ipu_plane->dp, false);