From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 1/4] drm/i915: fix ilk rc6 teardown locking Date: Sat, 19 Mar 2011 07:44:24 +0000 Message-ID: References: <1300489968-8574-1-git-send-email-ben@bwidawsk.net> <1300489968-8574-2-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id B7D289E7A8 for ; Sat, 19 Mar 2011 00:44:27 -0700 (PDT) In-Reply-To: <1300489968-8574-2-git-send-email-ben@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, 18 Mar 2011 16:12:45 -0700, Ben Widawsky 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