summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/panfrost/panfrost_device.h
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2020-11-05 16:17:04 +0100
committerSteven Price <steven.price@arm.com>2020-11-16 10:27:30 +0000
commit5bc5cc2819c2c0adb644919e3e790b504ea47e0a (patch)
tree4a8adff42279720578fe92fe5e80ce08b0a7c6f7 /drivers/gpu/drm/panfrost/panfrost_device.h
parent0003b687ee6d55b889f037530582493f353f0567 (diff)
downloadlinux-5bc5cc2819c2c0adb644919e3e790b504ea47e0a.tar.bz2
drm/panfrost: Move the GPU reset bits outside the timeout handler
We've fixed many races in panfrost_job_timedout() but some remain. Instead of trying to fix it again, let's simplify the logic and move the reset bits to a separate work scheduled when one of the queue reports a timeout. v5: - Simplify panfrost_scheduler_stop() (Steven Price) - Always restart the queue in panfrost_scheduler_start() even if the status is corrupted (Steven Price) v4: - Rework the logic to prevent a race between drm_sched_start() (reset work) and drm_sched_job_timedout() (timeout work) - Drop Steven's R-b - Add dma_fence annotation to the panfrost_reset() function (Daniel Vetter) v3: - Replace the atomic_cmpxchg() by an atomic_xchg() (Robin Murphy) - Add Steven's R-b v2: - Use atomic_cmpxchg() to conditionally schedule the reset work (Steven Price) Fixes: 1a11a88cfd9a ("drm/panfrost: Fix job timeout handling") Cc: <stable@vger.kernel.org> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201105151704.2010667-1-boris.brezillon@collabora.com
Diffstat (limited to 'drivers/gpu/drm/panfrost/panfrost_device.h')
-rw-r--r--drivers/gpu/drm/panfrost/panfrost_device.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h
index 140e004a3790..597cf1459b0a 100644
--- a/drivers/gpu/drm/panfrost/panfrost_device.h
+++ b/drivers/gpu/drm/panfrost/panfrost_device.h
@@ -106,7 +106,11 @@ struct panfrost_device {
struct panfrost_perfcnt *perfcnt;
struct mutex sched_lock;
- struct mutex reset_lock;
+
+ struct {
+ struct work_struct work;
+ atomic_t pending;
+ } reset;
struct mutex shrinker_lock;
struct list_head shrinker_list;