[Intel-xe] [RFC 1/4] drm/xe: Moving and renaming existing frequency sysfs attributes
Gupta, Anshuman
anshuman.gupta at intel.com
Wed Nov 22 14:32:12 UTC 2023
> -----Original Message-----
> From: Sundaresan, Sujaritha <sujaritha.sundaresan at intel.com>
> Sent: Wednesday, November 22, 2023 1:56 PM
> To: Dixit, Ashutosh <ashutosh.dixit at intel.com>; Tauro, Riana
> <riana.tauro at intel.com>
> Cc: intel-xe at lists.freedesktop.org; Vivi, Rodrigo <rodrigo.vivi at intel.com>; Gupta,
> Anshuman <anshuman.gupta at intel.com>
> Subject: Re: [Intel-xe] [RFC 1/4] drm/xe: Moving and renaming existing frequency
> sysfs attributes
>
>
> 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.
The issue is due to using wrong &dev->kobj to get gt.
dev represent kobj , which you had created with name "freq".
You can't get gt from kobj_to_gt, if you pass "freq" kobj.
Same is applicable to dev_to_pc() here in your patch.
Thanks,
Anshuman Gupta.
>
> 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