[Intel-gfx] [PATCH 2/2] drm/i915: Fix irq checks in ring->irq_get/put functions

Daniel Vetter daniel.vetter at ffwll.ch
Mon Sep 15 11:51:42 CEST 2014


On Mon, Sep 15, 2014 at 11:48 AM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> intel_engine_cs *ring)
>>       struct drm_i915_private *dev_priv = dev->dev_private;
>>       unsigned long flags;
>>
>> +     WARN_ON(!intel_irqs_enabled(dev_priv));
>
> Please no. This would be a BUG().

No BUG if not doing it means the driver will survive for a bit longer.
And doing a few bogus register writes usually means it'll surive.

Similar checks I've added just recently to pipestate_enable/disable
caught a bug in the resume code. Using a BUG instead of WARN would
have meant some serious debugging, but as-is a look at the backtrace
was all that was needed to analyze the bug.

I know a lot of developers disagree, but debugging random crap in the
field is _so_ much easier with WARN than BUG that it's not even up for
discussion imo.

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



More information about the Intel-gfx mailing list