[PATCH v4 02/17] drm/panfrost: Power the GPU up for a reset queued from the MMU code

From: Arun Iyengar via B4 Relay

Date: Thu Nov 26 2026 - 04:37:40 EST


From: Arun Iyengar <aiyengar1990@xxxxxxxxx>

panfrost_reset_work() calls panfrost_reset() without a runtime PM
reference, and the MMU code that queues it drops its own right after.
Take a reference in the work. A GPU that cannot be resumed is reset by
its next runtime resume, so clear reset.pending there. Not reproduced.

Fixes: f9ab9c66f080 ("drm/panfrost: Reset the GPU when the AS_ACTIVE bit is stuck")
Cc: stable@xxxxxxxxxxxxxxx
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Closes: https://lore.kernel.org/all/sashiko-outbox-206548@xxxxxxxxxx/
Closes: https://lore.kernel.org/all/sashiko-outbox-212557@xxxxxxxxxx/
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
v4: clear reset.pending in runtime resume (Sashiko 212557); system
sleep is left to patch 1.
---
drivers/gpu/drm/panfrost/panfrost_device.c | 1 +
drivers/gpu/drm/panfrost/panfrost_job.c | 5 +++++
2 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c
index 40eda3612..3c5f077db 100644
--- a/drivers/gpu/drm/panfrost/panfrost_device.c
+++ b/drivers/gpu/drm/panfrost/panfrost_device.c
@@ -540,6 +540,7 @@ static int panfrost_device_runtime_resume(struct device *dev)
}
}

+ atomic_set(&pfdev->reset.pending, 0);
panfrost_device_reset(pfdev, true);
panfrost_devfreq_resume(pfdev);

diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
index 79b302fef..b5b523cb2 100644
--- a/drivers/gpu/drm/panfrost/panfrost_job.c
+++ b/drivers/gpu/drm/panfrost/panfrost_job.c
@@ -810,7 +810,12 @@ static void panfrost_reset_work(struct work_struct *work)
struct panfrost_device *pfdev;

pfdev = container_of(work, struct panfrost_device, reset.work);
+
+ if (pm_runtime_resume_and_get(pfdev->base.dev))
+ return;
+
panfrost_reset(pfdev, NULL);
+ pm_runtime_put_autosuspend(pfdev->base.dev);
}

static const struct drm_sched_backend_ops panfrost_sched_ops = {

--
2.55.0