linux/drivers/gpu
geomcrae_amdeng 7de02fe953 drm/amdgpu: clean up discovery and preempt sysfs entries on shutdown
Fix a sysfs duplication error when reinitializing the device:

  sysfs: cannot create duplicate filename '.../ip_discovery'
  kobject_add_internal failed for ip_discovery with -EEXIST
  ...
  Failed to create device file mem_info_preempt_used (-17)

The failure is caused by stale sysfs entries not being removed during
device teardown, leading to -EEXIST when the driver is reprobed. In
particular:

- amdgpu_discovery sysfs kobjects were not fully torn down early enough,
  and ip_top remained non-NULL after cleanup
- the preempt manager sysfs attribute was removed only conditionally
  and not during the common hw fini path

Fix this by:
- making amdgpu_discovery_sysfs_fini() externally visible and clearing
  adev->discovery.ip_top to prevent reuse
- calling amdgpu_discovery_sysfs_fini() and
  amdgpu_preempt_mgr_sysfs_fini() from
  amdgpu_device_sys_interface_fini()

This ensures sysfs state is fully cleaned up before reprobe and avoids
duplicate kobject/file creation.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Geoffrey McRae <geoffrey.mcrae@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-06-17 16:30:15 -04:00
..
drm drm/amdgpu: clean up discovery and preempt sysfs entries on shutdown 2026-06-17 16:30:15 -04:00
host1x gpu: host1x: Fix iommu_map_sgtable() return value check 2026-05-28 17:19:30 +02:00
ipu-v3
nova-core gpu: nova-core: move lifetime to Bar0 2026-06-03 22:10:51 +02:00
tests gpu/tests/gpu_buddy: Add gpu_test_buddy_alloc_range for exact-range allocation 2026-03-09 13:58:12 +05:30
trace
vga
buddy.c drm/buddy: Integrate lockdep annotations for gpu buddy manager 2026-05-08 19:16:19 +05:30
Kconfig
Makefile gpu: Fix uninitialized buddy for built-in drivers 2026-02-24 13:40:59 +10:00