Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/panfrost: Move the GPU reset bits outside the timeout" failed to apply to 5.4-stable tree

PATCH [email protected] 1 participant 1 message Dec 28, 2020

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 5bc5cc2819c2c0adb644919e3e790b504ea47e0a Mon Sep 17 00:00:00 2001
From: Boris Brezillon <[email protected]>
Date: Thu, 5 Nov 2020 16:17:04 +0100
Subject: [PATCH] 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)

drivers/gpu/drm/panfrost/panfrost_device.c +0 -1
index 1daf9322954a..fbcf5edbe367 100644
@@ -200,7 +200,6 @@ int panfrost_device_init(struct panfrost_device *pfdev)
 	struct resource *res;
 
 	mutex_init(&pfdev->sched_lock);
-	mutex_init(&pfdev->reset_lock);
 	INIT_LIST_HEAD(&pfdev->scheduled_jobs);
 	INIT_LIST_HEAD(&pfdev->as_lru_list);
 
drivers/gpu/drm/panfrost/panfrost_device.h +5 -1
index 140e004a3790..597cf1459b0a 100644
@@ -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;
drivers/gpu/drm/panfrost/panfrost_job.c +125 -62

252 lines not on this page · raw message