Re: [Intel-gfx] [PATCH] drm/i915: Avoid refcount_inc on known zero count

2019-05-29 Thread Mika Kuoppala
Chris Wilson writes: > In intel_wakeref_auto, we use refcount_inc_not_zero to detect the first > use and initialise the timer. On doing so, we have to avoid using > refcount_inc on that zero count as the debug code flags that as an > error: > refcount_t: increment on 0; use-after-free. > Y

[Intel-gfx] [PATCH] drm/i915: Avoid refcount_inc on known zero count

2019-05-28 Thread Chris Wilson
In intel_wakeref_auto, we use refcount_inc_not_zero to detect the first use and initialise the timer. On doing so, we have to avoid using refcount_inc on that zero count as the debug code flags that as an error: refcount_t: increment on 0; use-after-free. Rearrange the code so that if we k