All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michał Winiarski" <michal.winiarski@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Unwind i915_gem_init() failure
Date: Fri, 8 Dec 2017 23:32:40 +0100	[thread overview]
Message-ID: <20171208223240.3qou6b43275fetc3@mwiniars-main.ger.corp.intel.com> (raw)
In-Reply-To: <20171208011720.5553-1-chris@chris-wilson.co.uk>

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@chris-wilson.co.uk>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
> Signed-off-by: Chris Wilson <chris@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? :>

Does what it says on the tin (fixing WARN_ON galore on guc load failure):

Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>

-Michał

> +	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
> +	mutex_unlock(&dev_priv->drm.struct_mutex);
> +
> +	if (ret != -EIO)
> +		i915_gem_cleanup_userptr(dev_priv);
> +
>  	if (ret == -EIO) {
> -		/* Allow engine initialisation to fail by marking the GPU as
> +		/*
> +		 * Allow engine initialisation to fail by marking the GPU as
>  		 * wedged. But we only want to do this where the GPU is angry,
>  		 * for all other failure, such as an allocation failure, bail.
>  		 */
> @@ -5199,9 +5252,8 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
>  		}
>  		ret = 0;
>  	}
> -	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
> -	mutex_unlock(&dev_priv->drm.struct_mutex);
>  
> +	i915_gem_drain_freed_objects(dev_priv);
>  	return ret;
>  }
>  
> -- 
> 2.15.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-12-08 22:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 23:56 [PATCH] drm/i915: Unwind i915_gem_init() failure Chris Wilson
2017-12-08  0:20 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-12-08  0:29 ` [PATCH] " Chris Wilson
2017-12-08  1:17 ` [PATCH v2] " Chris Wilson
2017-12-08 22:32   ` Michał Winiarski [this message]
2017-12-08 22:46     ` Chris Wilson
2017-12-08  1:53 ` ✓ Fi.CI.BAT: success for drm/i915: Unwind i915_gem_init() failure (rev2) Patchwork
2017-12-08  2:17 ` ✗ Fi.CI.IGT: warning for drm/i915: Unwind i915_gem_init() failure Patchwork
2017-12-08  3:34 ` ✗ Fi.CI.IGT: failure for drm/i915: Unwind i915_gem_init() failure (rev2) Patchwork
2017-12-11 11:19 ` [PATCH v3] drm/i915: Unwind i915_gem_init() failure Chris Wilson
2017-12-11 13:04 ` ✓ Fi.CI.BAT: success for drm/i915: Unwind i915_gem_init() failure (rev3) Patchwork
2017-12-11 13:17   ` Chris Wilson
2017-12-11 14:27 ` ✗ Fi.CI.IGT: failure " Patchwork
2017-12-13 13:43 ` [PATCH v3] drm/i915: Unwind i915_gem_init() failure Chris Wilson
2017-12-13 15:55 ` ✓ Fi.CI.BAT: success for drm/i915: Unwind i915_gem_init() failure (rev4) Patchwork
2017-12-13 18:26 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-12-13 18:56   ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171208223240.3qou6b43275fetc3@mwiniars-main.ger.corp.intel.com \
    --to=michal.winiarski@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.