Subject: drm/amdgpu: Skip GDS/GWS/OA TTM pool init when size is zero
From: <reporter>
Date: 2026-04-17

RDNA4 (GFX 12) removed the GDS, GWS, and OA on-chip memory resources.
gfx_v12_0.c correctly leaves adev->gds.{gds,gws,oa}_size at zero, but
amdgpu_ttm_init() unconditionally calls amdgpu_ttm_init_on_chip() with
these zero sizes, which ultimately calls drm_mm_init(mm, 0, 0) and hits
the DRM_MM_BUG_ON(start + size <= start) assertion, crashing the kernel
when loading amdgpu for an RX 9070 XT.

Fix by returning early in amdgpu_ttm_init_on_chip() when size_in_page is
zero, so no TTM resource manager is registered for absent hardware.

Reported-by: Chanisorn C. <bugzilla.kernel.org #221376>
Fixes: 473633540c2f ("drm/amdgpu/ttm: use the new resource manager")

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index XXXXXXX..YYYYYYY 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -74,6 +74,9 @@ static int amdgpu_ttm_init_on_chip(struct amdgpu_device *adev,
     unsigned int type,
     uint64_t size_in_page)
 {
+if (!size_in_page)
+return 0;
+
 return ttm_range_man_init(&adev->mman.bdev, type,
   false, size_in_page);
 }