Skip to contentSkip to conversation

drm/amdkfd: Return proper error code for gws alloc API

PATCH In review Zeng, Oak 2 participants 2 messages May 28, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Zeng, Oak

author
#0 lore raw

PATCH 1/1 drm/amdkfd: Return proper error code for gws alloc API

Change-Id Iaa81c6aa5f97e888291771e1aa70b02fccdcb9e0
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c       | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c               | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +1 -1
index 87177ed..e304271 100644
@@ -2124,7 +2124,7 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem
 
 	*mem = kzalloc(sizeof(struct kgd_mem), GFP_KERNEL);
 	if (!*mem)
-		return -EINVAL;
+		return -ENOMEM;
 
 	mutex_init(&(*mem)->lock);
 	(*mem)->bo = amdgpu_bo_ref(gws_bo);
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +1 -1
index aab2aa6..491f0dd 100644
@@ -1576,7 +1576,7 @@ static int kfd_ioctl_alloc_queue_gws(struct file *filep,
 
 	if (!hws_gws_support ||
 		dev->dqm->sched_policy == KFD_SCHED_POLICY_NO_HWS)
-		return -EINVAL;
+		return -ENODEV;
 
 	dev = kfd_device_by_id(args->gpu_id);
 	if (!dev) {
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +1 -1
index c2c570e..da09586 100644
@@ -103,7 +103,7 @@ int pqm_set_gws(struct process_queue_manager *pqm, unsigned int qid,
 
 	/* Only allow one queue per process can have GWS assigned */
 	if (gws && pdd->qpd.num_gws)
-		return -EINVAL;
+		return -EBUSY;
 
 	if (!gws && pdd->qpd.num_gws == 0)
 		return -EINVAL;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1559073185-26048-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Zeng, Oak <[email protected]>
Sent: Tuesday, May 28, 2019 3:53 PM
To: [email protected]
Cc: Kuehling, Felix; Zeng, Oak
Subject: [PATCH] drm/amdkfd: Return proper error code for gws alloc API

Change-Id Iaa81c6aa5f97e888291771e1aa70b02fccdcb9e0
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c       | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c               | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +1 -1
index 87177ed..e304271 100644
@@ -2124,7 +2124,7 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem
 
         *mem = kzalloc(sizeof(struct kgd_mem), GFP_KERNEL);
         if (!*mem)
-               return -EINVAL;
+               return -ENOMEM;
 
         mutex_init(&(*mem)->lock);
         (*mem)->bo = amdgpu_bo_ref(gws_bo);
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +1 -1
index aab2aa6..491f0dd 100644
@@ -1576,7 +1576,7 @@ static int kfd_ioctl_alloc_queue_gws(struct file *filep,
 
         if (!hws_gws_support ||
                 dev->dqm->sched_policy == KFD_SCHED_POLICY_NO_HWS)
-               return -EINVAL;
+               return -ENODEV;
 
         dev = kfd_device_by_id(args->gpu_id);
         if (!dev) {
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +1 -1
index c2c570e..da09586 100644
@@ -103,7 +103,7 @@ int pqm_set_gws(struct process_queue_manager *pqm, unsigned int qid,
 
         /* Only allow one queue per process can have GWS assigned */
         if (gws && pdd->qpd.num_gws)
-               return -EINVAL;
+               return -EBUSY;
 
         if (!gws && pdd->qpd.num_gws == 0)
                 return -EINVAL;

--
2.7.4

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx