From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Rothwell Subject: linux-next: manual merge of the tip tree with the drm tree Date: Thu, 17 Mar 2016 13:00:29 +1100 Message-ID: <20160317130029.5569b2f4@canb.auug.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from ozlabs.org ([103.22.144.67]:56608 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752581AbcCQCAc (ORCPT ); Wed, 16 Mar 2016 22:00:32 -0400 Sender: linux-next-owner@vger.kernel.org List-ID: To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Dave Airlie Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Christian =?UTF-8?B?S8O2bmln?= , Alex Deucher , Dave Hansen Hi all, Today's linux-next merge of the tip tree got a conflict in: drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c between commit: 637dd3b5ca9e ("drm/amdgpu: prevent get_user_pages recursion") from the drm tree and commit: d4edcf0d5695 ("mm/gup: Switch all callers of get_user_pages() to not pass tsk/mm") 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/amd/amdgpu/amdgpu_ttm.c index 0f42b1a24446,7b82e57aa09c..000000000000 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@@ -532,21 -516,9 +532,20 @@@ int amdgpu_ttm_tt_get_user_pages(struc do { unsigned num_pages = ttm->num_pages - pinned; uint64_t userptr = gtt->userptr + pinned * PAGE_SIZE; - struct page **pages = ttm->pages + pinned; + struct page **p = pages + pinned; + struct amdgpu_ttm_gup_task_list guptask; + + guptask.task = current; + spin_lock(>t->guptasklock); + list_add(&guptask.list, >t->guptasks); + spin_unlock(>t->guptasklock); - r = get_user_pages(current, current->mm, userptr, num_pages, - write, 0, p, NULL); + r = get_user_pages(userptr, num_pages, write, 0, pages, NULL); + + spin_lock(>t->guptasklock); + list_del(&guptask.list); + spin_unlock(>t->guptasklock); + if (r < 0) goto release_pages;