[PATCH 2/8] drm/xe: covert sysfs over to devm

Lucas De Marchi lucas.demarchi at intel.com
Mon Apr 29 13:52:40 UTC 2024


On Mon, Apr 29, 2024 at 09:28:00AM GMT, Rodrigo Vivi wrote:
>On Mon, Apr 29, 2024 at 01:14:38PM +0100, Matthew Auld wrote:
>> 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.
>
>hmmm... so basically we should use the drmm only for the global module
>stuff and the devm for things that are per device?

that doesn't make much sense. drmm is supposed to run when the driver
unbinds from the device... basically when all refcounts are gone with
drm_dev_put().  Are we keeping a ref we shouldn't?

Lucas De Marchi


More information about the Intel-xe mailing list