[PATCH v4 13/18] drm/panthor: Complain if the SOFT_RESET fails
From: Boris Brezillon
Date: Wed Aug 26 2026 - 10:59:07 EST
We rely on a functioning SOFT_RESET to avoid HW UAFs when the GPU was
in a state where AS commands were no longer accepted. If we silently
ignore RESET failures, we're just pretending to be safe while exposing
ourselves to the very UAFs we were trying to avoid. On the other hand,
there's basically nothing we can do if both the SOFT_RESET and the
AS_COMMAND(UNMAPPED) fail, so do what we do best: complain loudly and
taint the kernel with a WARN_ON().
Signed-off-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
---
drivers/gpu/drm/panthor/panthor_hw.h | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/panthor/panthor_hw.h b/drivers/gpu/drm/panthor/panthor_hw.h
index 4531c1239cb6..f13fd7b335c1 100644
--- a/drivers/gpu/drm/panthor/panthor_hw.h
+++ b/drivers/gpu/drm/panthor/panthor_hw.h
@@ -41,9 +41,17 @@ int panthor_hw_init(struct panthor_device *ptdev);
int panthor_hw_power_status_register(void);
void panthor_hw_power_status_unregister(void);
-static inline int panthor_hw_soft_reset(struct panthor_device *ptdev)
+static inline void
+panthor_hw_soft_reset(struct panthor_device *ptdev)
{
- return ptdev->hw->ops.soft_reset(ptdev);
+ /* We're relying on the SOFT_RESET to reset the MMU block if some AS
+ * were stuck for some reason. Failing to reset the MMU/L2 means we're
+ * exposing ourselves to HW UAFs. On the other hand, there's basically
+ * nothing we can do if both the SOFT_RESET and
+ * the AS_COMMAND(UNMAPPED) fail, so do what we do best: complain loudly
+ * and taint the kernel.
+ */
+ drm_WARN_ON(&ptdev->base, ptdev->hw->ops.soft_reset(ptdev));
}
static inline int panthor_hw_l2_power_on(struct panthor_device *ptdev)
--
2.55.0