[Intel-gfx] [PATCH 2/2] drm/i915: Don't BUG_ON in i915_gem_obj_offset
Daniel Vetter
daniel at ffwll.ch
Wed Jun 18 00:04:46 CEST 2014
On Tue, Jun 17, 2014 at 10:34:38PM +0200, Daniel Vetter wrote:
> A WARN_ON is perfectly fine.
>
> The BUG in here seems to be the cause behind hard-hangs when I cat the
> i915_gem_pageflip debugfs file (which calls this from an irq
> spinlock). But only while running a full igt run after a while. I
> still need to root cause the underlying issue.
>
> I'll also start reject patches which add new BUG_ON but don't come
> with a really good justification for it. The general rule really
> should be to just WARN and hope the driver survives for long enough.
>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
Both patches merged, this one improved per Chris' suggestions on irc.
-Daniel
> ---
> drivers/gpu/drm/i915/i915_gem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 35b5027ba5a4..841e9cd38dc1 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -5101,7 +5101,7 @@ unsigned long i915_gem_obj_offset(struct drm_i915_gem_object *o,
> vm == &dev_priv->mm.aliasing_ppgtt->base)
> vm = &dev_priv->gtt.base;
>
> - BUG_ON(list_empty(&o->vma_list));
> + WARN_ON(list_empty(&o->vma_list));
> list_for_each_entry(vma, &o->vma_list, vma_link) {
> if (vma->vm == vm)
> return vma->node.start;
> --
> 1.8.1.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the Intel-gfx
mailing list