Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753471AbcKCG1n (ORCPT ); Thu, 3 Nov 2016 02:27:43 -0400 Received: from terminus.zytor.com ([198.137.202.10]:41006 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbcKCG1l (ORCPT ); Thu, 3 Nov 2016 02:27:41 -0400 Date: Wed, 2 Nov 2016 23:25:20 -0700 From: tip-bot for Ingo Molnar Message-ID: Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, krinkin.m.u@gmail.com, mingo@kernel.org, hpa@zytor.com, airlied@redhat.com, hughd@google.com, paulmck@linux.vnet.ibm.com, torvalds@linux-foundation.org, tglx@linutronix.de, peterz@infradead.org Reply-To: paulmck@linux.vnet.ibm.com, torvalds@linux-foundation.org, hughd@google.com, airlied@redhat.com, hpa@zytor.com, mingo@kernel.org, krinkin.m.u@gmail.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/drm: Fix i915_gem_shrinker_lock() locking Git-Commit-ID: c7faee2109f978f3ef826c48b7e60609061fda4f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1916 Lines: 53 Commit-ID: c7faee2109f978f3ef826c48b7e60609061fda4f Gitweb: http://git.kernel.org/tip/c7faee2109f978f3ef826c48b7e60609061fda4f Author: Ingo Molnar AuthorDate: Thu, 3 Nov 2016 07:16:43 +0100 Committer: Ingo Molnar CommitDate: Thu, 3 Nov 2016 07:21:12 +0100 locking/drm: Fix i915_gem_shrinker_lock() locking Mike Krinkin reported hangs in the DRM code and bisected it to: 3ab7c086d5ec72585ef0 ("locking/drm: Kill mutex trickery") Hugh Dickins observed: "i915_gem_shrinker_lock() is broken: but copy the pattern from msm_gem_shrinker_lock() and it's okay - patch below." Pick up the fix in isolation to make sure the bug is fixed, cleanup patch will follow up. Originally-From: Hugh Dickins Reported-by: Hugh Dickins Reported-by: Mike Krinkin Cc: Andrew Morton Cc: Dave Airlie Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: chris@chris-wilson.co.uk Cc: jason.low2@hpe.com Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1610301645180.28429@eggly.anvils Signed-off-by: Ingo Molnar --- drivers/gpu/drm/i915/i915_gem_shrinker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c index 3695375..e9bd2a8 100644 --- a/drivers/gpu/drm/i915/i915_gem_shrinker.c +++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c @@ -228,8 +228,9 @@ unsigned long i915_gem_shrink_all(struct drm_i915_private *dev_priv) static bool i915_gem_shrinker_lock(struct drm_device *dev, bool *unlock) { if (!mutex_trylock(&dev->struct_mutex)) - *unlock = false; + return false; + *unlock = true; return true; }