[PATCH v8 09/16] drm/panfrost: Add warning messages to fatal error conditions

From: Adrián Larumbe

Date: Mon Sep 07 2026 - 16:18:13 EST


Rather than just failing silently, let's warn the user of device remove not
being able to take an PM reference or the PM suspend path still reporting
inflight jobs. Neither situation should ever happen.

Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
Signed-off-by: Adrián Larumbe <adrian.larumbe@xxxxxxxxxxxxx>
---
drivers/gpu/drm/panfrost/panfrost_device.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c
index be4443e41d9a..f0fae6fa1e24 100644
--- a/drivers/gpu/drm/panfrost/panfrost_device.c
+++ b/drivers/gpu/drm/panfrost/panfrost_device.c
@@ -9,6 +9,7 @@
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <drm/drm_drv.h>
+#include <drm/drm_print.h>

#include "panfrost_device.h"
#include "panfrost_devfreq.h"
@@ -343,7 +344,7 @@ int panfrost_device_init(struct panfrost_device *pfdev)

void panfrost_device_fini(struct panfrost_device *pfdev)
{
- pm_runtime_get_sync(pfdev->base.dev);
+ drm_WARN_ON(&pfdev->base, pm_runtime_get_sync(pfdev->base.dev) < 0);

pm_runtime_dont_use_autosuspend(pfdev->base.dev);
pm_runtime_disable(pfdev->base.dev);
@@ -501,7 +502,7 @@ static int panfrost_device_runtime_suspend(struct device *dev)
{
struct panfrost_device *pfdev = dev_get_drvdata(dev);

- if (!panfrost_jm_is_idle(pfdev))
+ if (drm_WARN_ON(&pfdev->base, !panfrost_jm_is_idle(pfdev)))
return -EBUSY;

panfrost_devfreq_suspend(pfdev);

--
2.55.0