Skip to content

Commit 33cc891

Browse files
ChristianKoenigAMDalexdeucher
authored andcommitted
drm/amdgpu: hide VRAM sysfs attributes on GPUs without VRAM
Otherwise accessing them can cause a crash. Signed-off-by: Christian König <[email protected]> Tested-by: Mangesh Gadre <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Arunpravin Paneer Selvam <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 74de0ea commit 33cc891

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ static umode_t amdgpu_vram_attrs_is_visible(struct kobject *kobj,
234234
!adev->gmc.vram_vendor)
235235
return 0;
236236

237+
if (!ttm_resource_manager_used(&adev->mman.vram_mgr.manager))
238+
return 0;
239+
237240
return attr->mode;
238241
}
239242

0 commit comments

Comments
 (0)