From: Stephen Rothwell Subject: Re: [PATCH 1/1] drm/amdgpu: adopt to hmm_range_register API change Date: Mon, 8 Jul 2019 09:30:20 +1000 Message-ID: <20190708093020.676f5b3f@canb.auug.org.au> References: <20190703015442.11974-1-Felix.Kuehling@amd.com> <20190703141001.GH18688@mellanox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1915976656==" Return-path: Received: from ozlabs.org (ozlabs.org [203.11.71.1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 38E5C899DC for ; Sun, 7 Jul 2019 23:30:36 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Alex Deucher Cc: "Yang, Philip" , Dave Airlie , "Kuehling, Felix" , "dri-devel@lists.freedesktop.org" , "linux-mm@kvack.org" , Jason Gunthorpe , "linux-next@vger.kernel.org" , "Deucher, Alexander" List-Id: dri-devel@lists.freedesktop.org --===============1915976656== Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/n1sGdhtFox.8qpMNicerEzu"; protocol="application/pgp-signature" --Sig_/n1sGdhtFox.8qpMNicerEzu Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi all, On Wed, 3 Jul 2019 17:09:16 -0400 Alex Deucher wrot= e: > > On Wed, Jul 3, 2019 at 5:03 PM Kuehling, Felix w= rote: > > > > On 2019-07-03 10:10 a.m., Jason Gunthorpe wrote: =20 > > > On Wed, Jul 03, 2019 at 01:55:08AM +0000, Kuehling, Felix wrote: =20 > > >> From: Philip Yang > > >> > > >> In order to pass mirror instead of mm to hmm_range_register, we need > > >> pass bo instead of ttm to amdgpu_ttm_tt_get_user_pages because mirror > > >> is part of amdgpu_mn structure, which is accessible from bo. > > >> > > >> Signed-off-by: Philip Yang > > >> Reviewed-by: Felix Kuehling > > >> Signed-off-by: Felix Kuehling > > >> CC: Stephen Rothwell > > >> CC: Jason Gunthorpe > > >> CC: Dave Airlie > > >> CC: Alex Deucher > > >> --- > > >> drivers/gpu/drm/Kconfig | 1 - > > >> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 5 ++--- > > >> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- > > >> drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 3 +-- > > >> drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 8 ++++++++ > > >> drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h | 5 +++++ > > >> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 12 ++++++++++-- > > >> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 5 +++-- > > >> 8 files changed, 30 insertions(+), 11 deletions(-) =20 > > > This is too big to use as a conflict resolution, what you could do is > > > apply the majority of the patch on top of your tree as-is (ie keep > > > using the old hmm_range_register), then the conflict resolution for > > > the updated AMD GPU tree can be a simple one line change: > > > > > > - hmm_range_register(range, mm, start, > > > + hmm_range_register(range, mirror, start, > > > start + ttm->num_pages * PAGE_SIZE, PAGE_SHI= FT); > > > > > > Which is trivial for everone to deal with, and solves the problem. =20 > > > > Good idea. With the changes added to the amdgpu tree over the weekend, I will apply the following merge fix patch to the hmm merge today: From: Philip Yang Sibject: drm/amdgpu: adopt to hmm_range_register API change Signed-off-by: Stephen Rothwell diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/= amdgpu/amdgpu_ttm.c @@ -783,7 +783,7 @@ int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, st= ruct page **pages) 0 : range->flags[HMM_PFN_WRITE]; range->pfn_flags_mask =3D 0; range->pfns =3D pfns; - hmm_range_register(range, mm, start, + hmm_range_register(range, mirror, start, start + ttm->num_pages * PAGE_SIZE, PAGE_SHIFT); =20 retry: And someone just needs to make sure Linus is aware of this needed merge fix. --=20 Cheers, Stephen Rothwell --Sig_/n1sGdhtFox.8qpMNicerEzu Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAl0igIwACgkQAVBC80lX 0GyMGwf9EHaqFsgZMnIUpi3rDZiJtUaKYpZhMRcEnEUKTBt9R7GcNMCmg+yWNWQm ywXAzxy+94GmfnusEKWBCpCTTO9IyjctxH5P4i/myGwF867vEhGMXD2fg5ly85hr oyQ60dHXBwNKwJlfoNfgC7XJ/sYSVrtngHZ+Up6SkAPlMccSJ+V4zQLi5qI8CjOz Nqt8Eh+OHyjqZf9UdzFWAtHNO4rbIutkbdkh4YVD6V3USbcU2wJ1/8dmR8xIlvXL BVWfIWkeX0lN+ASoK1Y3GL5RJB9ge5nRvmaRC5Tmq3dF9au7ihOveKfdqy+HdvWQ cPEh8VGzNdBfQ1l0rDzj7y04IDNndg== =yA1W -----END PGP SIGNATURE----- --Sig_/n1sGdhtFox.8qpMNicerEzu-- --===============1915976656== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============1915976656==--