]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amdgpu: Allocate root PD on correct partition
authorGuchun Chen <guchun.chen@amd.com>
Mon, 17 Jul 2023 01:55:07 +0000 (09:55 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 18 Jul 2023 18:42:23 +0000 (14:42 -0400)
file_priv needs to be setup firstly, otherwise, root PD
will always be allocated on partition 0, even if opening
the device from other partitions.

Fixes: 3ebfd221c1a8 ("drm/amdkfd: Store xcp partition id to amdgpu bo")
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

index cca5a495611f3ba1454d0ecfb231618f64e019cb..61d5472d60a67f05cb5b261aa3a8b0956258812b 100644 (file)
@@ -1229,13 +1229,13 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
                pasid = 0;
        }
 
-       r = amdgpu_vm_init(adev, &fpriv->vm);
+       r = amdgpu_xcp_open_device(adev, fpriv, file_priv);
        if (r)
                goto error_pasid;
 
-       r = amdgpu_xcp_open_device(adev, fpriv, file_priv);
+       r = amdgpu_vm_init(adev, &fpriv->vm);
        if (r)
-               goto error_vm;
+               goto error_pasid;
 
        r = amdgpu_vm_set_pasid(adev, &fpriv->vm, pasid);
        if (r)