drm/panfrost: Reset the GPU when the AS_ACTIVE bit is stuck
authorBoris Brezillon <boris.brezillon@collabora.com>
Wed, 30 Jun 2021 06:27:47 +0000 (08:27 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Thu, 1 Jul 2021 06:53:34 +0000 (08:53 +0200)
Things are unlikely to resolve until we reset the GPU. Let's not wait
for other faults/timeout to happen to trigger this reset.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-13-boris.brezillon@collabora.com
drivers/gpu/drm/panfrost/panfrost_mmu.c

index 959da77..e0356e6 100644 (file)
@@ -36,8 +36,11 @@ static int wait_ready(struct panfrost_device *pfdev, u32 as_nr)
        ret = readl_relaxed_poll_timeout_atomic(pfdev->iomem + AS_STATUS(as_nr),
                val, !(val & AS_STATUS_AS_ACTIVE), 10, 1000);
 
-       if (ret)
+       if (ret) {
+               /* The GPU hung, let's trigger a reset */
+               panfrost_device_schedule_reset(pfdev);
                dev_err(pfdev->dev, "AS_ACTIVE bit stuck\n");
+       }
 
        return ret;
 }