diff options
| author | Matthew Auld <matthew.auld@intel.com> | 2024-05-22 11:21:45 +0100 |
|---|---|---|
| committer | Matthew Auld <matthew.auld@intel.com> | 2024-05-22 13:22:38 +0100 |
| commit | c60f91bbc4bcd91f9c7f3de36c541951b12d165a (patch) | |
| tree | 0ac0cc9964ad2780e16ee6263daa2b38c2cbb978 /drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | |
| parent | 4465b8c6d3539811ce576f163cb3bf3890e5c883 (diff) | |
| download | linux-next-c60f91bbc4bcd91f9c7f3de36c541951b12d165a.tar.gz linux-next-c60f91bbc4bcd91f9c7f3de36c541951b12d165a.zip | |
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_hw_engine_class_sysfs.c')
| -rw-r--r-- | drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c index efce6c7dd2a2..b53e8d2accdb 100644 --- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c +++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c @@ -492,7 +492,7 @@ static const struct attribute * const files[] = { NULL }; -static void kobj_xe_hw_engine_class_fini(struct drm_device *drm, void *arg) +static void kobj_xe_hw_engine_class_fini(void *arg) { struct kobject *kobj = arg; @@ -517,7 +517,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char } keclass->xe = xe; - err = drmm_add_action_or_reset(&xe->drm, kobj_xe_hw_engine_class_fini, + err = devm_add_action_or_reset(xe->drm.dev, kobj_xe_hw_engine_class_fini, &keclass->base); if (err) return NULL; @@ -525,7 +525,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char return keclass; } -static void hw_engine_class_defaults_fini(struct drm_device *drm, void *arg) +static void hw_engine_class_defaults_fini(void *arg) { struct kobject *kobj = arg; @@ -552,7 +552,7 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe, if (err) goto err_object; - return drmm_add_action_or_reset(&xe->drm, hw_engine_class_defaults_fini, kobj); + return devm_add_action_or_reset(xe->drm.dev, hw_engine_class_defaults_fini, kobj); err_object: kobject_put(kobj); @@ -611,7 +611,7 @@ static const struct kobj_type xe_hw_engine_sysfs_kobj_type = { .sysfs_ops = &xe_hw_engine_class_sysfs_ops, }; -static void hw_engine_class_sysfs_fini(struct drm_device *drm, void *arg) +static void hw_engine_class_sysfs_fini(void *arg) { struct kobject *kobj = arg; @@ -680,7 +680,7 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt) goto err_object; } - return drmm_add_action_or_reset(&xe->drm, hw_engine_class_sysfs_fini, kobj); + return devm_add_action_or_reset(xe->drm.dev, hw_engine_class_sysfs_fini, kobj); err_object: kobject_put(kobj); |
