[Intel-xe] [PATCH 2/3] drm/xe: Register drm device prior to gt init

Upadhyay, Tejas tejas.upadhyay at intel.com
Thu May 4 12:17:28 UTC 2023



> -----Original Message-----
> From: Iddamsetty, Aravind <aravind.iddamsetty at intel.com>
> Sent: Thursday, May 4, 2023 5:34 PM
> To: Upadhyay, Tejas <tejas.upadhyay at intel.com>; intel-
> xe at lists.freedesktop.org
> Subject: Re: [Intel-xe] [PATCH 2/3] drm/xe: Register drm device prior to gt init
> 
> 
> 
> On 04-05-2023 16:50, Tejas Upadhyay wrote:
> > GT init creates few sysfs entries under /sys/class/drm and makes use
> > of drm_class device thus it needs drm device to be registered prior to
> > gt init.
> >
> > Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
> > ---
> >  drivers/gpu/drm/xe/xe_device.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_device.c
> > b/drivers/gpu/drm/xe/xe_device.c index 45d6e5ff47fd..c5380914da18
> > 100644
> > --- a/drivers/gpu/drm/xe/xe_device.c
> > +++ b/drivers/gpu/drm/xe/xe_device.c
> > @@ -301,6 +301,10 @@ int xe_device_probe(struct xe_device *xe)
> >  	if (err)
> >  		goto err_irq_shutdown;
> >
> > +	err = drm_dev_register(&xe->drm, 0);
> I do not think it is necessary as we are not creating the file node under
> /sys/class/drm but rather under /sys/bus/pci/devices/B:D:F/

If we are not creating file under /sys/class/drm then you are right. So then what should be right for sysfs, should it have gt/gt<N> or just gt<N>?

Thanks,
Tejas 
> 
> Thanks,
> Aravind.
> > +	if (err)
> > +		goto err_irq_shutdown;
> > +
> >  	for_each_gt(gt, xe, id) {
> >  		err = xe_gt_init(gt);
> >  		if (err)
> > @@ -311,10 +315,6 @@ int xe_device_probe(struct xe_device *xe)
> >  	if (err)
> >  		goto err_fini_display;
> >
> > -	err = drm_dev_register(&xe->drm, 0);
> > -	if (err)
> > -		goto err_irq_shutdown;
> > -
> >  	xe_display_register(xe);
> >
> >  	xe_debugfs_register(xe);


More information about the Intel-xe mailing list