dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues
@ 2015-01-29  8:35 Oded Gabbay
  2015-01-29  8:35 ` [PATCH 2/3] drm/amdkfd: max num of queues can't be 0 Oded Gabbay
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Oded Gabbay @ 2015-01-29  8:35 UTC (permalink / raw)
  To: dri-devel

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 0d8694f..0fd5927 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -822,7 +822,7 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm,
 	 * Unconditionally decrement this counter, regardless of the queue's
 	 * type.
 	 */
-	dqm->total_queue_count++;
+	dqm->total_queue_count--;
 	pr_debug("Total of %d queues are accountable so far\n",
 			dqm->total_queue_count);
 	mutex_unlock(&dqm->lock);
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 2/3] drm/amdkfd: max num of queues can't be 0
  2015-01-29  8:35 [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues Oded Gabbay
@ 2015-01-29  8:35 ` Oded Gabbay
  2015-01-29  8:35 ` [PATCH 3/3] drm/amdkfd: Don't create BUG due to incorrect user parameter Oded Gabbay
  2015-01-29 15:55 ` [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues Alex Deucher
  2 siblings, 0 replies; 5+ messages in thread
From: Oded Gabbay @ 2015-01-29  8:35 UTC (permalink / raw)
  To: dri-devel

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_module.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
index a8be6df..1c385c2 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
@@ -95,10 +95,10 @@ static int __init kfd_module_init(void)
 	}
 
 	/* Verify module parameters */
-	if ((max_num_of_queues_per_device < 0) ||
+	if ((max_num_of_queues_per_device < 1) ||
 		(max_num_of_queues_per_device >
 			KFD_MAX_NUM_OF_QUEUES_PER_DEVICE)) {
-		pr_err("kfd: max_num_of_queues_per_device must be between 0 to KFD_MAX_NUM_OF_QUEUES_PER_DEVICE\n");
+		pr_err("kfd: max_num_of_queues_per_device must be between 1 to KFD_MAX_NUM_OF_QUEUES_PER_DEVICE\n");
 		return -1;
 	}
 
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 3/3] drm/amdkfd: Don't create BUG due to incorrect user parameter
  2015-01-29  8:35 [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues Oded Gabbay
  2015-01-29  8:35 ` [PATCH 2/3] drm/amdkfd: max num of queues can't be 0 Oded Gabbay
@ 2015-01-29  8:35 ` Oded Gabbay
  2015-01-29  9:54   ` Zhou, Jammy
  2015-01-29 15:55 ` [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues Alex Deucher
  2 siblings, 1 reply; 5+ messages in thread
From: Oded Gabbay @ 2015-01-29  8:35 UTC (permalink / raw)
  To: dri-devel

This patch changes a BUG_ON() statement to pr_debug, in case the user tries to
update a non-existing queue.

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Reviewed-by: Ben Goz <ben.goz@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 f37cf5e..2fda1927 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -315,7 +315,11 @@ int pqm_update_queue(struct process_queue_manager *pqm, unsigned int qid,
 	BUG_ON(!pqm);
 
 	pqn = get_queue_by_qid(pqm, qid);
-	BUG_ON(!pqn);
+	if (!pqn) {
+		pr_debug("amdkfd: No queue %d exists for update operation\n",
+				qid);
+		return -EFAULT;
+	}
 
 	pqn->q->properties.queue_address = p->queue_address;
 	pqn->q->properties.queue_size = p->queue_size;
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* RE: [PATCH 3/3] drm/amdkfd: Don't create BUG due to incorrect user parameter
  2015-01-29  8:35 ` [PATCH 3/3] drm/amdkfd: Don't create BUG due to incorrect user parameter Oded Gabbay
@ 2015-01-29  9:54   ` Zhou, Jammy
  0 siblings, 0 replies; 5+ messages in thread
From: Zhou, Jammy @ 2015-01-29  9:54 UTC (permalink / raw)
  To: Gabbay, Oded, dri-devel@lists.freedesktop.org

The series are Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>

Regards,
Jammy

-----Original Message-----
From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of Gabbay, Oded
Sent: Thursday, January 29, 2015 4:35 PM
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 3/3] drm/amdkfd: Don't create BUG due to incorrect user parameter

This patch changes a BUG_ON() statement to pr_debug, in case the user tries to update a non-existing queue.

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Reviewed-by: Ben Goz <ben.goz@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 f37cf5e..2fda1927 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -315,7 +315,11 @@ int pqm_update_queue(struct process_queue_manager *pqm, unsigned int qid,
 	BUG_ON(!pqm);
 
 	pqn = get_queue_by_qid(pqm, qid);
-	BUG_ON(!pqn);
+	if (!pqn) {
+		pr_debug("amdkfd: No queue %d exists for update operation\n",
+				qid);
+		return -EFAULT;
+	}
 
 	pqn->q->properties.queue_address = p->queue_address;
 	pqn->q->properties.queue_size = p->queue_size;
--
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues
  2015-01-29  8:35 [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues Oded Gabbay
  2015-01-29  8:35 ` [PATCH 2/3] drm/amdkfd: max num of queues can't be 0 Oded Gabbay
  2015-01-29  8:35 ` [PATCH 3/3] drm/amdkfd: Don't create BUG due to incorrect user parameter Oded Gabbay
@ 2015-01-29 15:55 ` Alex Deucher
  2 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2015-01-29 15:55 UTC (permalink / raw)
  To: Oded Gabbay; +Cc: Maling list - DRI developers

On Thu, Jan 29, 2015 at 3:35 AM, Oded Gabbay <oded.gabbay@amd.com> wrote:
> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>

For the series:

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> index 0d8694f..0fd5927 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> @@ -822,7 +822,7 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm,
>          * Unconditionally decrement this counter, regardless of the queue's
>          * type.
>          */
> -       dqm->total_queue_count++;
> +       dqm->total_queue_count--;
>         pr_debug("Total of %d queues are accountable so far\n",
>                         dqm->total_queue_count);
>         mutex_unlock(&dqm->lock);
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2015-01-29 15:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-29  8:35 [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues Oded Gabbay
2015-01-29  8:35 ` [PATCH 2/3] drm/amdkfd: max num of queues can't be 0 Oded Gabbay
2015-01-29  8:35 ` [PATCH 3/3] drm/amdkfd: Don't create BUG due to incorrect user parameter Oded Gabbay
2015-01-29  9:54   ` Zhou, Jammy
2015-01-29 15:55 ` [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues Alex Deucher

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