AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: hide VRAM sysfs attributes on GPUs without VRAM
@ 2025-10-07  9:19 Christian König
  2025-10-07 10:29 ` Gadre, Mangesh
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Christian König @ 2025-10-07  9:19 UTC (permalink / raw)
  To: alexander.deucher, amd-gfx

Otherwise accessing them can cause a crash.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index a5adb2ed9b3c..9d934c07fa6b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -234,6 +234,9 @@ static umode_t amdgpu_vram_attrs_is_visible(struct kobject *kobj,
 	    !adev->gmc.vram_vendor)
 		return 0;
 
+	if (!ttm_resource_manager_used(&adev->mman.vram_mgr.manager))
+		return 0;
+
 	return attr->mode;
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-09  6:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-07  9:19 [PATCH] drm/amdgpu: hide VRAM sysfs attributes on GPUs without VRAM Christian König
2025-10-07 10:29 ` Gadre, Mangesh
2025-10-07 12:36 ` Alex Deucher
2025-10-08 15:00 ` Christian König
2025-10-09  6:00   ` Arunpravin Paneer Selvam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox