diff options
author | Matthew Auld <matthew.auld@intel.com> | 2024-05-22 13:21:45 +0300 |
---|---|---|
committer | Matthew Auld <matthew.auld@intel.com> | 2024-05-22 15:22:38 +0300 |
commit | c60f91bbc4bcd91f9c7f3de36c541951b12d165a (patch) | |
tree | 0ac0cc9964ad2780e16ee6263daa2b38c2cbb978 /drivers/gpu/drm/xe/xe_device_sysfs.c | |
parent | 4465b8c6d3539811ce576f163cb3bf3890e5c883 (diff) | |
download | linux-c60f91bbc4bcd91f9c7f3de36c541951b12d165a.tar.xz |
drm/xe: covert sysfs over to devm
Hotunplugging the device seems to result in stuff like:
kobject_add_internal failed for tile0 with -EEXIST, don't try to
register things with the same name in the same directory.
We only remove the sysfs as part of drmm, however that is tied to the
lifetime of the driver instance and not the device underneath. Attempt
to fix by using devm for all of the remaining sysfs stuff related to the
device.
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1667
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1432
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240522102143.128069-20-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_device_sysfs.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_device_sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c index 21677b8cd977..7375937934fa 100644 --- a/drivers/gpu/drm/xe/xe_device_sysfs.c +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c @@ -69,7 +69,7 @@ vram_d3cold_threshold_store(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR_RW(vram_d3cold_threshold); -static void xe_device_sysfs_fini(struct drm_device *drm, void *arg) +static void xe_device_sysfs_fini(void *arg) { struct xe_device *xe = arg; @@ -85,5 +85,5 @@ int xe_device_sysfs_init(struct xe_device *xe) if (ret) return ret; - return drmm_add_action_or_reset(&xe->drm, xe_device_sysfs_fini, xe); + return devm_add_action_or_reset(dev, xe_device_sysfs_fini, xe); } |