]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/omap: DMM: Check for DMM readiness after successful transaction commit
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 29 Sep 2017 11:49:49 +0000 (14:49 +0300)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:33:51 +0000 (21:33 -0400)
[ Upstream commit b7ea6b286c4051e043f691781785e3c4672f014a ]

Check the status of the DMM engine after it is reported that the
transaction was completed as in rare cases the engine might not reached a
working state.

The wait_status() will print information in case the DMM is not reached the
expected state and the dmm_txn_commit() will return with an error code to
make sure that we are not continuing with a broken setup.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c

index 6e6634cd1d17ecc78089ce49b8edfa8ddd9df62b..9eedb17a6b1b5cc6f948faeb71eb64211af491e1 100644 (file)
@@ -287,7 +287,12 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait)
                                msecs_to_jiffies(1))) {
                        dev_err(dmm->dev, "timed out waiting for done\n");
                        ret = -ETIMEDOUT;
+                       goto cleanup;
                }
+
+               /* Check the engine status before continue */
+               ret = wait_status(engine, DMM_PATSTATUS_READY |
+                                 DMM_PATSTATUS_VALID | DMM_PATSTATUS_DONE);
        }
 
 cleanup: