From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031575AbcCQQwq (ORCPT ); Thu, 17 Mar 2016 12:52:46 -0400 Received: from mga02.intel.com ([134.134.136.20]:7011 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031244AbcCQQwl (ORCPT ); Thu, 17 Mar 2016 12:52:41 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,350,1455004800"; d="scan'208";a="913165259" Subject: Re: linux-next: manual merge of the tip tree with the drm tree To: Arnd Bergmann , Stephen Rothwell References: <20160317130029.5569b2f4@canb.auug.org.au> <2913254.nLUtoX01AU@wuerfel> Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Dave Airlie , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Christian_K=c3=b6nig?= , Alex Deucher From: Dave Hansen Message-ID: <56EAE0D8.8030501@linux.intel.com> Date: Thu, 17 Mar 2016 09:52:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <2913254.nLUtoX01AU@wuerfel> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/17/2016 02:00 AM, Arnd Bergmann wrote: > On Thursday 17 March 2016 13:00:29 Stephen Rothwell wrote: >> > - 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; ... > Your merge looks incorrect to me, and I got a build warning for it: > > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_ttm_tt_get_user_pages': > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:535:17: error: unused variable 'p' [-Werror=unused-variable] > > I think the one-line change below is what is needed here, but it's probably > best for amdgpu maintainers to take a closer look. > > Signed-off-by: Arnd Bergmann > > index 8b9b245fd0c8..ab34190859a8 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > @@ -540,7 +540,7 @@ int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages) > list_add(&guptask.list, >t->guptasks); > spin_unlock(>t->guptasklock); > > - r = get_user_pages(userptr, num_pages, write, 0, pages, NULL); > + r = get_user_pages(userptr, num_pages, write, 0, p, NULL); > > spin_lock(>t->guptasklock); > list_del(&guptask.list); Yeah, Arnd's fix looks correct to me. The loop variable "pages" got renamed to "p" and another variable "pages" is now being passed into the function. The get_user_pages() call should be against 'p', the loop variable. Also, this is obvious if you consider that the pkeys patch was always just removing the first two arguments. We can see in Stephen's patch above that it both removes those arguments *and* replaces 'p' with 'pages'.