[PATCH] drm/i915: Reduce a pin-leak BUG into a WARN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 15, 2012 at 09:41:57AM +0100, Chris Wilson wrote:
> Pin-leaks persist and we get the perennial bug reports of machine
> lockups to the BUG_ON(pin_count==MAX). If we instead loudly report that
> the object cannot be pinned at that time it should prevent the driver from
> locking up, and hopefully restore a semblance of working whilst still
> leaving us a OOPS to debug.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Picked up for -fixes, thanks for the patch. wrt pin leaks, I think all the
ones we still have are worker thread starvations, combined with irqs
firing too fast. /should/ be fixable ...
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index da17b40..58a5f6a 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3555,7 +3555,8 @@ i915_gem_object_pin(struct drm_i915_gem_object *obj,
>  {
>  	int ret;
>  
> -	BUG_ON(obj->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT);
> +	if (WARN_ON(obj->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT))
> +		return -EBUSY;
>  
>  	if (obj->gtt_space != NULL) {
>  		if ((alignment && obj->gtt_offset & (alignment - 1)) ||
> -- 
> 1.7.10.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux