From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752906AbcKHEZp (ORCPT ); Mon, 7 Nov 2016 23:25:45 -0500 Received: from ozlabs.org ([103.22.144.67]:56759 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892AbcKHEZo (ORCPT ); Mon, 7 Nov 2016 23:25:44 -0500 Date: Tue, 8 Nov 2016 15:25:41 +1100 From: Stephen Rothwell To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Daniel Vetter , Intel Graphics , DRI Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Wilson Subject: linux-next: manual merge of the tip tree with the drm-intel tree Message-ID: <20161108152541.096711bb@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, FIXME: Add owner of second tree to To: Add author(s)/SOB of conflicting commits. Today's linux-next merge of the tip tree got a conflict in: drivers/gpu/drm/i915/i915_gem_shrinker.c between commits: 1233e2db199d ("drm/i915: Move object backing storage manipulation to its own locking") from the drm-intel tree and commit: 3ab7c086d5ec ("locking/drm: Kill mutex trickery") c7faee2109f9 ("locking/drm: Fix i915_gem_shrinker_lock() locking") from the tip tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. -- Cheers, Stephen Rothwell diff --cc drivers/gpu/drm/i915/i915_gem_shrinker.c index a6fc1bdc48af,e9bd2a81d03a..000000000000 --- a/drivers/gpu/drm/i915/i915_gem_shrinker.c +++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c @@@ -35,33 -35,6 +35,15 @@@ #include "i915_drv.h" #include "i915_trace.h" - static bool mutex_is_locked_by(struct mutex *mutex, struct task_struct *task) - { - if (!mutex_is_locked(mutex)) - return false; - - #if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_MUTEX_SPIN_ON_OWNER) - return mutex->owner == task; - #else - /* Since UP may be pre-empted, we cannot assume that we own the lock */ - return false; - #endif - } - +static bool i915_gem_shrinker_lock(struct drm_device *dev, bool *unlock) +{ - if (!mutex_trylock(&dev->struct_mutex)) { - if (!mutex_is_locked_by(&dev->struct_mutex, current)) - return false; - - *unlock = false; - } else { - *unlock = true; - } ++ if (!mutex_trylock(&dev->struct_mutex)) ++ return false; + ++ *unlock = true; + return true; +} + static bool any_vma_pinned(struct drm_i915_gem_object *obj) { struct i915_vma *vma;