]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: hide VRAM sysfs attributes on GPUs without VRAM
authorChristian König <christian.koenig@amd.com>
Tue, 7 Oct 2025 08:10:52 +0000 (10:10 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Oct 2025 18:14:15 +0000 (14:14 -0400)
Otherwise accessing them can cause a crash.

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: Mangesh Gadre <Mangesh.Gadre@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c

index a5adb2ed9b3c6e1a18fb5771fda537697cad1414..9d934c07fa6b8b921edfe4c861c63fa6da6f5b93 100644 (file)
@@ -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;
 }