aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2128-drm-amdkfd-Fix-a-logical-error-in-calculating-SDMA-e.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2128-drm-amdkfd-Fix-a-logical-error-in-calculating-SDMA-e.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2128-drm-amdkfd-Fix-a-logical-error-in-calculating-SDMA-e.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2128-drm-amdkfd-Fix-a-logical-error-in-calculating-SDMA-e.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2128-drm-amdkfd-Fix-a-logical-error-in-calculating-SDMA-e.patch
new file mode 100644
index 00000000..268c2f58
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2128-drm-amdkfd-Fix-a-logical-error-in-calculating-SDMA-e.patch
@@ -0,0 +1,63 @@
+From 59d2f6bcc97144a60aa4123c03131af3c5be3312 Mon Sep 17 00:00:00 2001
+From: Yong Zhao <yong.zhao@amd.com>
+Date: Tue, 17 Oct 2017 17:02:14 -0400
+Subject: [PATCH 2128/4131] drm/amdkfd: Fix a logical error in calculating SDMA
+ engine id and queue id
+
+The denominator should be CIK_SDMA_ENGINE_NUM instead of
+CIK_SDMA_QUEUES_PER_ENGINE. The error did not cause any issue though,
+because they were equal.
+
+Change-Id: Ib2e22dd187bf68dbf4322e063ed8019030f3a5e9
+Signed-off-by: Yong Zhao <yong.zhao@amd.com>
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 8 ++++----
+ drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 3 ++-
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+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 e762a59..cd0990e 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+@@ -863,8 +863,8 @@ static int create_sdma_queue_nocpsch(struct device_queue_manager *dqm,
+ if (retval)
+ return retval;
+
+- q->properties.sdma_queue_id = q->sdma_id / CIK_SDMA_QUEUES_PER_ENGINE;
+- q->properties.sdma_engine_id = q->sdma_id % CIK_SDMA_QUEUES_PER_ENGINE;
++ q->properties.sdma_queue_id = q->sdma_id / CIK_SDMA_ENGINE_NUM;
++ q->properties.sdma_engine_id = q->sdma_id % CIK_SDMA_ENGINE_NUM;
+
+ retval = allocate_doorbell(qpd, q);
+ if (retval)
+@@ -1088,9 +1088,9 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
+ if (retval)
+ goto out_unlock;
+ q->properties.sdma_queue_id =
+- q->sdma_id / CIK_SDMA_QUEUES_PER_ENGINE;
++ q->sdma_id / CIK_SDMA_ENGINE_NUM;
+ q->properties.sdma_engine_id =
+- q->sdma_id % CIK_SDMA_QUEUES_PER_ENGINE;
++ q->sdma_id % CIK_SDMA_ENGINE_NUM;
+ }
+
+ retval = allocate_doorbell(qpd, q);
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
+index 841283a..ac9a24f 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
+@@ -34,9 +34,10 @@
+ #define QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS (2 * KFD_UNMAP_LATENCY_MS + 1000)
+
+ #define KFD_DQM_FIRST_PIPE (0)
+-#define CIK_SDMA_QUEUES (4)
+ #define CIK_SDMA_QUEUES_PER_ENGINE (2)
+ #define CIK_SDMA_ENGINE_NUM (2)
++#define CIK_SDMA_QUEUES (CIK_SDMA_QUEUES_PER_ENGINE \
++ * CIK_SDMA_ENGINE_NUM)
+
+ struct device_process_node {
+ struct qcm_process_device *qpd;
+--
+2.7.4
+