[Intel-xe] [RFC 1/4] drm/xe: Moving and renaming existing frequency sysfs attributes

Sundaresan, Sujaritha sujaritha.sundaresan at intel.com
Wed Nov 22 08:25:43 UTC 2023


On 11/21/2023 10:28 AM, Dixit, Ashutosh wrote:
> On Mon, 20 Nov 2023 20:50:00 -0800, Riana Tauro wrote:
>>>    @@ -950,6 +950,7 @@ int xe_guc_pc_init(struct xe_guc_pc *pc)
>>> 	struct xe_tile *tile = gt_to_tile(gt);
>>> 	struct xe_device *xe = gt_to_xe(gt);
>>> 	struct xe_bo *bo;
>>> +	struct kobject *kobj;
>>> 	u32 size = PAGE_ALIGN(sizeof(struct slpc_shared_data));
>>> 	int err;
>>>    @@ -965,7 +966,9 @@ int xe_guc_pc_init(struct xe_guc_pc *pc)
>>> 		pc->bo = bo;
>>>    -	err = sysfs_create_files(gt->sysfs, pc_attrs);
>>> +	kobj = kobject_create_and_add("freq", gt->sysfs);
>> Handle error here
>>> +
>>> +	err = sysfs_create_files(kobj, pc_attrs); >	if (err)
>> add kobject put if creating files returns error
>>
>> also clean up on finish
> These are needed too but won't fix the kernel crash. Look at existing sysfs
> functions, at least i915 has those.
>
> Hint: the issue is creating the new freq directory.

I think overall, since we are looking to add other sub directories 
inside the new gt/freq directory, it's

better to have that be a mid layer as Rodrigo suggested in the review 
for the throttle reasons patch.

That will make it easier to point to the other directories being created 
with freq as well.

Thanks,

Suja



More information about the Intel-xe mailing list