[PATCH] drm/xe: fix enable survivability mode

Francois Dugast francois.dugast at intel.com
Thu Mar 6 11:00:09 UTC 2025


On Thu, Mar 06, 2025 at 12:05:53AM -0600, Lucas De Marchi wrote:
> On Thu, Mar 06, 2025 at 12:04:06AM -0600, Lucas De Marchi wrote:
> > On Thu, Mar 06, 2025 at 11:24:07AM +0530, Riana Tauro wrote:
> > > The current implementation skipped entering survivability mode even when
> > > survivability enable returned success. Enter survivability mode
> > > if enable returns success
> > > 
> > > Fixes: d40f275d96e8 ("drm/xe: Move survivability entirely to xe_pci")
> > > Signed-off-by: Riana Tauro <riana.tauro at intel.com>
> 
> Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>
> 
> Lucas De Marchi
> 
> > > ---
> > > drivers/gpu/drm/xe/xe_pci.c | 5 ++---
> > > 1 file changed, 2 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> > > index 6b5fa067b39b..ee0665e54489 100644
> > > --- a/drivers/gpu/drm/xe/xe_pci.c
> > > +++ b/drivers/gpu/drm/xe/xe_pci.c
> > > @@ -857,9 +857,8 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> > > 	 * HW to be enabled. In that case enable it and return success.
> > > 	 */
> > > 	if (err) {
> > > -		if (xe_survivability_mode_required(xe) &&
> > > -		    xe_survivability_mode_enable(xe))
> > > -			return 0;
> > > +		if (xe_survivability_mode_required(xe))
> > > +			return xe_survivability_mode_enable(xe);
> > 
> > ugh... the mix of bool and int above threw me off. I remember fixing it
> > but probably forgot to put it in the series.
> > 
> > +Francois
> > 
> > Can we inject 2 errors to easily test this in igt?
> > 
> > 1. xe_device_probe_early() to return error

Yes sure. BTW just tried that locally and it leads to a kernel NULL
pointer dereference. If that is confirmed, this is another good example
why we should test error paths with fault injection.

> > 2. xe_survivability_mode_required to return true

That seems not to work, we would need to change return type to int.

Francois

> > 
> > Thanks,
> > Lucas De Marchi
> > 
> > 
> > > 
> > > 		return err;
> > > 	}
> > > -- 
> > > 2.47.1
> > > 


More information about the Intel-xe mailing list