diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3344-drm-amdkfd-Rectify-the-jiffies-calculation-error-wit.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3344-drm-amdkfd-Rectify-the-jiffies-calculation-error-wit.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3344-drm-amdkfd-Rectify-the-jiffies-calculation-error-wit.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3344-drm-amdkfd-Rectify-the-jiffies-calculation-error-wit.patch new file mode 100644 index 00000000..dc9ada67 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3344-drm-amdkfd-Rectify-the-jiffies-calculation-error-wit.patch @@ -0,0 +1,57 @@ +From c0c0c2381bd3cc6ceb56582c8df5febc0d199f9b Mon Sep 17 00:00:00 2001 +From: Yong Zhao <yong.zhao@amd.com> +Date: Wed, 20 Sep 2017 18:10:15 -0400 +Subject: [PATCH 3344/4131] drm/amdkfd: Rectify the jiffies calculation error + with milliseconds v2 + +The timeout in milliseconds should not be regarded as jiffies. This +commit fixed that. + +v2: +- use msecs_to_jiffies +- change timeout_ms parameter to unsigned int to match msecs_to_jiffies + +Signed-off-by: Yong Zhao <yong.zhao@amd.com> +Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> +Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com> +--- + drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 6 +++--- + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- + 2 files changed, 4 insertions(+), 4 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 5db82b8..87961fe 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +@@ -835,12 +835,12 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q, + + int amdkfd_fence_wait_timeout(unsigned int *fence_addr, + unsigned int fence_value, +- unsigned long timeout) ++ unsigned int timeout_ms) + { +- timeout += jiffies; ++ unsigned long end_jiffies = msecs_to_jiffies(timeout_ms) + jiffies; + + while (*fence_addr != fence_value) { +- if (time_after(jiffies, timeout)) { ++ if (time_after(jiffies, end_jiffies)) { + pr_err("qcm fence wait loop timeout expired\n"); + return -ETIME; + } +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +index 5d9bdc5..83befe2 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +@@ -671,7 +671,7 @@ struct kernel_queue *pqm_get_kernel_queue(struct process_queue_manager *pqm, + + int amdkfd_fence_wait_timeout(unsigned int *fence_addr, + unsigned int fence_value, +- unsigned long timeout); ++ unsigned int timeout_ms); + + /* Packet Manager */ + +-- +2.7.4 + |