]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: Remove sys file compute_partition_mem_alloc_mode at module unload
authorXiaogang Chen <xiaogang.chen@amd.com>
Tue, 7 Apr 2026 21:16:23 +0000 (16:16 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 Apr 2026 18:45:26 +0000 (14:45 -0400)
Module reload would fail when create sys file that was not removed during
module unload.

Fixes: e0e9792ea2d4 ("drm/amdgpu: add an option to allow gpu partition allocate all available memory")
Signed-off-by: Xiaogang Chen <xiaogang.chen@amd.com>
Reviewed-by: Philip Yang <philip.yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

index 2956e45c92549b68760d351c351b0315f6a6b07b..b8ca876694ff802cc073904f132b3ea48cd0f915 100644 (file)
@@ -2013,6 +2013,8 @@ static void amdgpu_gfx_sysfs_xcp_fini(struct amdgpu_device *adev)
                (xcp_mgr->funcs && xcp_mgr->funcs->switch_partition_mode);
        device_remove_file(adev->dev, &dev_attr_current_compute_partition);
 
+       device_remove_file(adev->dev, &dev_attr_compute_partition_mem_alloc_mode);
+
        if (xcp_switch_supported)
                device_remove_file(adev->dev,
                                   &dev_attr_available_compute_partition);