<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Zeng, Oak <Oak.Zeng@amd.com><br>
<b>Sent:</b> Tuesday, May 28, 2019 3:53 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Kuehling, Felix; Zeng, Oak<br>
<b>Subject:</b> [PATCH] drm/amdkfd: Return proper error code for gws alloc API</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Change-Id: Iaa81c6aa5f97e888291771e1aa70b02fccdcb9e0<br>
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-<br>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +-<br>
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 2 +-<br>
3 files changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c<br>
index 87177ed..e304271 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c<br>
@@ -2124,7 +2124,7 @@ int amdgpu_amdkfd_add_gws_to_process(void *info, void *gws, struct kgd_mem **mem<br>
<br>
*mem = kzalloc(sizeof(struct kgd_mem), GFP_KERNEL);<br>
if (!*mem)<br>
- return -EINVAL;<br>
+ return -ENOMEM;<br>
<br>
mutex_init(&(*mem)->lock);<br>
(*mem)->bo = amdgpu_bo_ref(gws_bo);<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c<br>
index aab2aa6..491f0dd 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c<br>
@@ -1576,7 +1576,7 @@ static int kfd_ioctl_alloc_queue_gws(struct file *filep,<br>
<br>
if (!hws_gws_support ||<br>
dev->dqm->sched_policy == KFD_SCHED_POLICY_NO_HWS)<br>
- return -EINVAL;<br>
+ return -ENODEV;<br>
<br>
dev = kfd_device_by_id(args->gpu_id);<br>
if (!dev) {<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c<br>
index c2c570e..da09586 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c<br>
@@ -103,7 +103,7 @@ int pqm_set_gws(struct process_queue_manager *pqm, unsigned int qid,<br>
<br>
/* Only allow one queue per process can have GWS assigned */<br>
if (gws && pdd->qpd.num_gws)<br>
- return -EINVAL;<br>
+ return -EBUSY;<br>
<br>
if (!gws && pdd->qpd.num_gws == 0)<br>
return -EINVAL;<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></div>
</span></font></div>
</body>
</html>