[Intel-gfx] [PATCH] drm/i915/gen9: fix error path in intel_init_workaround_bb

Chris Wilson chris at chris-wilson.co.uk
Tue Jun 23 07:31:49 PDT 2015


On Tue, Jun 23, 2015 at 05:26:13PM +0300, Imre Deak wrote:
> On the GEN!=8 error path we call kmap_atomic() which returns in atomic
> context and then lrc_destroy_wa_ctx_obj() which can be called only in
> process context. Fix this by preserving the correct cleanup order on
> this error path.
> 
> Also convert the WARN to DRM_ERROR the stack trace isn't really useful.
> 
> Signed-off-by: Imre Deak <imre.deak at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_lrc.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 1b50dd7..8bff1a2 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1289,10 +1289,14 @@ static int intel_init_workaround_bb(struct intel_engine_cs *ring)
>  		if (ret)
>  			goto out;
>  	} else {
> -		WARN(INTEL_INFO(ring->dev)->gen >= 8,
> -		     "WA batch buffer is not initialized for Gen%d\n",
> -		     INTEL_INFO(ring->dev)->gen);
> +		if (INTEL_INFO(ring->dev)->gen >= 8)
> +			DRM_ERROR("WA batch buffer is not initialized for Gen%d\n",
> +				  INTEL_INFO(ring->dev)->gen);
> +

Do this test upfront, then we don't have multiple error paths.
http://paste.debian.net/255769
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list