diff options
author | Oak Zeng <Oak.Zeng@amd.com> | 2019-05-28 14:51:49 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-05-31 10:39:33 -0500 |
commit | 443e902eeef96f3bed54a7067c50a07f06074373 (patch) | |
tree | e5ae5f0f123a521eefd47132589f302456601b09 /drivers/gpu | |
parent | 4fd334122399a133ddaee8ef865eb10a1cf8000f (diff) | |
download | linux-443e902eeef96f3bed54a7067c50a07f06074373.tar.bz2 |
drm/amdkfd: Return proper error code for gws alloc API
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index 87177ed37dd2..e30427161295 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -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); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index ea82828fdc76..f91126f5f1be 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -1575,15 +1575,15 @@ static int kfd_ioctl_alloc_queue_gws(struct file *filep, struct kfd_dev *dev; if (!hws_gws_support) - return -EINVAL; + return -ENODEV; dev = kfd_device_by_id(args->gpu_id); if (!dev) { pr_debug("Could not find gpu id 0x%x\n", args->gpu_id); - return -EINVAL; + return -ENODEV; } if (dev->dqm->sched_policy == KFD_SCHED_POLICY_NO_HWS) - return -EINVAL; + return -ENODEV; mutex_lock(&p->mutex); retval = pqm_set_gws(&p->pqm, args->queue_id, args->num_gws ? dev->gws : NULL); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c index c2c570e6e54f..da0958625861 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c @@ -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; |