AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/amdgpu: Allocate root PD on correct partition
@ 2023-07-18  5:13 Guchun Chen
  2023-07-18  5:13 ` [PATCH 2/4] drm/amdgpu: fix slab-out-of-bounds issue in amdgpu_vm_pt_create Guchun Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Guchun Chen @ 2023-07-18  5:13 UTC (permalink / raw)
  To: amd-gfx, alexander.deucher, hawking.zhang, christian.koenig,
	Philip.Yang, Felix.Kuehling
  Cc: Guchun Chen

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: ffc6deb773f7 ("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>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 85a0d5f419c8..53a024cf0544 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -1232,13 +1232,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)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH 1/4] drm/amdgpu: Allocate root PD on correct partition
@ 2023-07-17  2:26 Guchun Chen
  2023-07-17  2:26 ` [PATCH 4/4] drm/amdgpu: use a macro to define no xcp partition case Guchun Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Guchun Chen @ 2023-07-17  2:26 UTC (permalink / raw)
  To: amd-gfx, alexander.deucher, hawking.zhang, christian.koenig,
	Philip.Yang, Felix.Kuehling
  Cc: Guchun Chen

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.

Signed-off-by: Guchun Chen <guchun.chen@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 85a0d5f419c8..53a024cf0544 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -1232,13 +1232,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)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-08  6:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18  5:13 [PATCH 1/4] drm/amdgpu: Allocate root PD on correct partition Guchun Chen
2023-07-18  5:13 ` [PATCH 2/4] drm/amdgpu: fix slab-out-of-bounds issue in amdgpu_vm_pt_create Guchun Chen
2023-07-18  5:13 ` [PATCH 3/4] drm/amdgpu/vm: use the same xcp_id from root PD Guchun Chen
2023-07-18  5:13 ` [PATCH 4/4] drm/amdgpu: use a macro to define no xcp partition case Guchun Chen
2023-08-08  6:30   ` Christian König
  -- strict thread matches above, loose matches on Subject: below --
2023-07-17  2:26 [PATCH 1/4] drm/amdgpu: Allocate root PD on correct partition Guchun Chen
2023-07-17  2:26 ` [PATCH 4/4] drm/amdgpu: use a macro to define no xcp partition case Guchun Chen
2023-07-17 14:58   ` Felix Kuehling
2023-07-18  2:16     ` Chen, Guchun
2023-08-03  8:28       ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox