[Intel-gfx] [PATCH 1/4] drm/i915: fix ilk rc6 teardown locking

Chris Wilson chris at chris-wilson.co.uk
Sat Mar 19 08:44:24 CET 2011


On Fri, 18 Mar 2011 16:12:45 -0700, Ben Widawsky <ben at bwidawsk.net> wrote:
> In the failure cases during rc6 initialization, both the power context
> and render context may get !refcount without holding struct_mutex.
> 
> However, on rc6 disabling, the lock is held by the caller.
> 
> Added a simple parameter to control whether or not to acquire the lock.

I have an aversion to passing parameters around to control locking.
Considering that we modify dev_private and adjust LP_RING during enable,
wouldn't it be prudent to move that under the struct mutex? Especially in
the future if we allow it be enabled at runtime.

Failing that: bool was_locked = mutex_is_locked(&dev->struct_mutex);
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list