* [PATCH 1/3] drm/amdkfd: Remove negative check of uint variable
@ 2015-01-22 9:42 Oded Gabbay
2015-01-22 9:42 ` [PATCH 2/3] drm/amdkfd: Add break at the end of case Oded Gabbay
2015-01-22 9:42 ` [PATCH 3/3] drm/amdkfd: Handle case of invalid queue type Oded Gabbay
0 siblings, 2 replies; 5+ messages in thread
From: Oded Gabbay @ 2015-01-22 9:42 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 a5c69e9..23a1e95 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -587,7 +587,7 @@ static int allocate_sdma_queue(struct device_queue_manager *dqm,
static void deallocate_sdma_queue(struct device_queue_manager *dqm,
unsigned int sdma_queue_id)
{
- if (sdma_queue_id < 0 || sdma_queue_id >= CIK_SDMA_QUEUES)
+ if (sdma_queue_id >= CIK_SDMA_QUEUES)
return;
set_bit(sdma_queue_id, (unsigned long *)&dqm->sdma_bitmap);
}
--
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: Add break at the end of case
2015-01-22 9:42 [PATCH 1/3] drm/amdkfd: Remove negative check of uint variable Oded Gabbay
@ 2015-01-22 9:42 ` Oded Gabbay
2015-01-22 9:42 ` [PATCH 3/3] drm/amdkfd: Handle case of invalid queue type Oded Gabbay
1 sibling, 0 replies; 5+ messages in thread
From: Oded Gabbay @ 2015-01-22 9:42 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 | 3 +++
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 3 +++
2 files changed, 6 insertions(+)
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 23a1e95..85387c8 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -1114,8 +1114,11 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_dev *dev)
switch (dev->device_info->asic_family) {
case CHIP_CARRIZO:
device_queue_manager_init_vi(&dqm->ops_asic_specific);
+ break;
+
case CHIP_KAVERI:
device_queue_manager_init_cik(&dqm->ops_asic_specific);
+ break;
}
if (dqm->ops.initialize(dqm) != 0) {
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
index c04b1ac..e415a2a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
@@ -288,8 +288,11 @@ struct kernel_queue *kernel_queue_init(struct kfd_dev *dev,
switch (dev->device_info->asic_family) {
case CHIP_CARRIZO:
kernel_queue_init_vi(&kq->ops_asic_specific);
+ break;
+
case CHIP_KAVERI:
kernel_queue_init_cik(&kq->ops_asic_specific);
+ break;
}
if (kq->ops.initialize(kq, dev, type, KFD_KERNEL_QUEUE_SIZE) == false) {
--
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: Handle case of invalid queue type
2015-01-22 9:42 [PATCH 1/3] drm/amdkfd: Remove negative check of uint variable Oded Gabbay
2015-01-22 9:42 ` [PATCH 2/3] drm/amdkfd: Add break at the end of case Oded Gabbay
@ 2015-01-22 9:42 ` Oded Gabbay
2015-01-22 10:28 ` Zhou, Jammy
1 sibling, 1 reply; 5+ messages in thread
From: Oded Gabbay @ 2015-01-22 9:42 UTC (permalink / raw)
To: dri-devel
This patch handles a case where amdkfd tries to destroy a queue but the queue
type is invalid.
This case occurs in non-HWS path.
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
---
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 +++++
1 file changed, 5 insertions(+)
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 85387c8..99e2dbb 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -301,6 +301,11 @@ static int destroy_queue_nocpsch(struct device_queue_manager *dqm,
}
dqm->sdma_queue_count--;
deallocate_sdma_queue(dqm, q->sdma_id);
+ } else {
+ pr_debug("q->properties.type is invalid (%d)\n",
+ q->properties.type);
+ retval = -EINVAL;
+ goto out;
}
retval = mqd->destroy_mqd(mqd, q->mqd,
--
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: Handle case of invalid queue type
2015-01-22 9:42 ` [PATCH 3/3] drm/amdkfd: Handle case of invalid queue type Oded Gabbay
@ 2015-01-22 10:28 ` Zhou, Jammy
2015-01-22 10:28 ` Oded Gabbay
0 siblings, 1 reply; 5+ messages in thread
From: Zhou, Jammy @ 2015-01-22 10:28 UTC (permalink / raw)
To: Gabbay, Oded, dri-devel@lists.freedesktop.org
Patches 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 22, 2015 5:42 PM
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 3/3] drm/amdkfd: Handle case of invalid queue type
This patch handles a case where amdkfd tries to destroy a queue but the queue type is invalid.
This case occurs in non-HWS path.
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
---
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 +++++
1 file changed, 5 insertions(+)
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 85387c8..99e2dbb 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -301,6 +301,11 @@ static int destroy_queue_nocpsch(struct device_queue_manager *dqm,
}
dqm->sdma_queue_count--;
deallocate_sdma_queue(dqm, q->sdma_id);
+ } else {
+ pr_debug("q->properties.type is invalid (%d)\n",
+ q->properties.type);
+ retval = -EINVAL;
+ goto out;
}
retval = mqd->destroy_mqd(mqd, q->mqd,
--
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 3/3] drm/amdkfd: Handle case of invalid queue type
2015-01-22 10:28 ` Zhou, Jammy
@ 2015-01-22 10:28 ` Oded Gabbay
0 siblings, 0 replies; 5+ messages in thread
From: Oded Gabbay @ 2015-01-22 10:28 UTC (permalink / raw)
To: Zhou, Jammy, dri-devel@lists.freedesktop.org
On 01/22/2015 12:28 PM, Zhou, Jammy wrote:
> Patches are Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
>
> Regards,
> Jammy
>
Thanks!
Oded
> -----Original Message-----
> From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of Gabbay, Oded
> Sent: Thursday, January 22, 2015 5:42 PM
> To: dri-devel@lists.freedesktop.org
> Subject: [PATCH 3/3] drm/amdkfd: Handle case of invalid queue type
>
> This patch handles a case where amdkfd tries to destroy a queue but the queue type is invalid.
> This case occurs in non-HWS path.
>
> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> 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 85387c8..99e2dbb 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> @@ -301,6 +301,11 @@ static int destroy_queue_nocpsch(struct device_queue_manager *dqm,
> }
> dqm->sdma_queue_count--;
> deallocate_sdma_queue(dqm, q->sdma_id);
> + } else {
> + pr_debug("q->properties.type is invalid (%d)\n",
> + q->properties.type);
> + retval = -EINVAL;
> + goto out;
> }
>
> retval = mqd->destroy_mqd(mqd, q->mqd,
> --
> 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-22 10:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-22 9:42 [PATCH 1/3] drm/amdkfd: Remove negative check of uint variable Oded Gabbay
2015-01-22 9:42 ` [PATCH 2/3] drm/amdkfd: Add break at the end of case Oded Gabbay
2015-01-22 9:42 ` [PATCH 3/3] drm/amdkfd: Handle case of invalid queue type Oded Gabbay
2015-01-22 10:28 ` Zhou, Jammy
2015-01-22 10:28 ` Oded Gabbay
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.