drm/amdgpu: always register an MMU notifier for userptr
authorChristian König <christian.koenig@amd.com>
Wed, 9 Nov 2022 11:14:44 +0000 (12:14 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 21 Nov 2022 21:40:04 +0000 (16:40 -0500)
Since switching to HMM we always need that because we no longer grab
references to the pages.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
CC: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

index 8ef31d6..111484c 100644 (file)
@@ -413,11 +413,9 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
        if (r)
                goto release_object;
 
-       if (args->flags & AMDGPU_GEM_USERPTR_REGISTER) {
-               r = amdgpu_mn_register(bo, args->addr);
-               if (r)
-                       goto release_object;
-       }
+       r = amdgpu_mn_register(bo, args->addr);
+       if (r)
+               goto release_object;
 
        if (args->flags & AMDGPU_GEM_USERPTR_VALIDATE) {
                r = amdgpu_ttm_tt_get_user_pages(bo, bo->tbo.ttm->pages);