[PATCH 5/7] drm/xe: Cleanup unwind of gt initialization

Raag Jadav raag.jadav at intel.com
Sun Feb 2 08:09:21 UTC 2025


On Sat, Feb 01, 2025 at 09:55:47AM -0600, Lucas De Marchi wrote:
> On Sat, Feb 01, 2025 at 08:24:50AM +0200, Raag Jadav wrote:
> > On Fri, Jan 31, 2025 at 02:31:38PM -0800, Lucas De Marchi wrote:
> > > Move the xe_gt_remove() to be handled by xe_gt.c itself so the caller,
> > > xe_device_probe() doesn't have to unwind the gt loop. It's also more in
> > > line with the xe_device_probe() style.
> > > 
> > > Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> > > ---
> > >  drivers/gpu/drm/xe/xe_device.c | 21 ++-----------------
> > >  drivers/gpu/drm/xe/xe_gt.c     | 37 ++++++++++++++++------------------
> > >  drivers/gpu/drm/xe/xe_gt.h     |  1 -
> > >  3 files changed, 19 insertions(+), 40 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> > > index e519f435b1606..bea626f6b4cbf 100644
> > > --- a/drivers/gpu/drm/xe/xe_device.c
> > > +++ b/drivers/gpu/drm/xe/xe_device.c
> > > @@ -743,7 +743,6 @@ int xe_device_probe(struct xe_device *xe)
> > >  	struct xe_tile *tile;
> > >  	struct xe_gt *gt;
> > >  	int err;
> > > -	u8 last_gt;
> > >  	u8 id;
> > > 
> > >  	xe_pat_init_early(xe);
> > > @@ -851,18 +850,16 @@ int xe_device_probe(struct xe_device *xe)
> > >  		return err;
> > > 
> > >  	for_each_gt(gt, xe, id) {
> > > -		last_gt = id;
> > > -
> > >  		err = xe_gt_init(gt);
> > >  		if (err)
> > > -			goto err_fini_gt;
> > > +			return err;
> > 
> > So it's either all or nothing? Can't we operate with atleast what we have?
> 
> it was already like that, this is just moving the check to be in a
> better place.
> 
> But yes, we've decided long ago that it's better to fail early and fix
> it rather than having semi-working driver in production.

Sure, makes sense.

Reviewed-by: Raag Jadav <raag.jadav at intel.com>


More information about the Intel-xe mailing list