From: Boris Brezillon Date: Wed, 30 Jun 2021 06:27:47 +0000 (+0200) Subject: drm/panfrost: Reset the GPU when the AS_ACTIVE bit is stuck X-Git-Tag: v5.15-rc1~148^2~23^2~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9ab9c66f08082a143ac529f1e479b987c2a1fa1;p=thirdparty%2Fkernel%2Flinux.git drm/panfrost: Reset the GPU when the AS_ACTIVE bit is stuck 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 Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-13-boris.brezillon@collabora.com --- diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index 959da770295cd..e0356e68e7680 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -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; }