[Intel-gfx] [PATCH v2] drm/i915: Unwind i915_gem_init() failure
Chris Wilson
chris at chris-wilson.co.uk
Fri Dec 8 22:46:18 UTC 2017
Quoting Michał Winiarski (2017-12-08 22:32:40)
> On Fri, Dec 08, 2017 at 01:17:20AM +0000, Chris Wilson wrote:
> > Since Michal introduced new errors other than -EIO during
> > i915_gem_init(), we need to actually unwind on the error path as we have
> > to abort the module load (and we expect to do so cleanly!).
> >
> > As we now teardown key state and then mark the driver as wedged (on
> > EIO), we have to be careful to not allow ourselves to resume and
> > unwedge, thus attempting to use the uninitialised driver.
> >
> > v2: Try not to free driver state for the suppressed EIO
> >
> > References: 8620eb1dbbf2 ("drm/i915/uc: Don't use -EIO to report missing firmware")
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> > Cc: Sagar Arun Kamble <sagar.a.kamble at intel.com>
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > ---
> > drivers/gpu/drm/i915/i915_gem.c | 82 +++++++++++++++++++++++++++++++++--------
> > 1 file changed, 67 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > index c7b5db78fbb4..ee243e1ef706 100644
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
>
> [SNIP]
>
> > +err_ggtt:
> > +err_unlock:
>
> So... Just unlock? :>
Nothing to see here, please move along. I was caught by surprise that we
didn't have an immediate cleanup for err_ggtt.
>
> Does what it says on the tin (fixing WARN_ON galore on guc load failure):
>
> Reviewed-by: Michał Winiarski <michal.winiarski at intel.com>
Bug not in an elegant way, going it the w/e and see if someone comes up
with a better way.
As a note to self, if we also have a
if (i915_inject_load_failure())
return -ENODEV;
then we will automatically exercise both failure methods.
I say automatically, except basic-reload-inject uses a hard-coded max
number of passes. Fantastic.
-Chris
More information about the Intel-gfx
mailing list