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>
*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);
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);
/* 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;