[PATCH v3 04/14] drm/panfrost: Don't WARN when a GEM mapping cannot get its pages
From: Arun Iyengar via B4 Relay
Date: Fri Nov 13 2026 - 05:02:16 EST
From: Arun Iyengar <aiyengar1990@xxxxxxxxx>
drm_gem_shmem_get_pages_sgt() fails with -ENOMEM when the caller's
memory cgroup is at its limit, or with -EINTR when the caller is being
killed. Userspace gets the error (Mesa: "DRM_IOCTL_PANFROST_CREATE_BO
failed (err=12)"), but the WARN_ON() in panfrost_mmu_map() also prints a
backtrace:
WARNING: drivers/gpu/drm/panfrost/panfrost_mmu.c:478 at panfrost_mmu_map+0xcc
dEQP-GLES31.functional.draw_indirect.compute_interop.large.* in a 600 MB
memory cgroup on a 1 GB Mali-G31 board prints it five times.
Drop the WARN_ON(). No pages are held at this point, so there is nothing
to undo.
Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c
index d0c6b6635..74fd159de 100644
--- a/drivers/gpu/drm/panfrost/panfrost_mmu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c
@@ -480,7 +480,7 @@ int panfrost_mmu_map(struct panfrost_gem_mapping *mapping)
prot |= IOMMU_NOEXEC;
sgt = drm_gem_shmem_get_pages_sgt(shmem);
- if (WARN_ON(IS_ERR(sgt)))
+ if (IS_ERR(sgt))
return PTR_ERR(sgt);
ret = mmu_map_sg(pfdev, mapping->mmu, mapping->mmnode.start << PAGE_SHIFT,
--
2.55.0