aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
diff options
context:
space:
mode:
authorOded Gabbay <oded.gabbay@amd.com>2014-11-17 13:18:32 +0200
committerOded Gabbay <oded.gabbay@amd.com>2014-11-17 13:18:32 +0200
commit9a5634a72934a566b3e5fdb0e8f345846162f7d3 (patch)
tree84dde270498d7911238e3a5fe07589cb5eb6a504 /drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
parentamdkfd: Fix memory leak on process deregistration (diff)
downloadlinux-dev-9a5634a72934a566b3e5fdb0e8f345846162f7d3.tar.xz
linux-dev-9a5634a72934a566b3e5fdb0e8f345846162f7d3.zip
amdkfd: use schedule() in sync_with_hw
amdkfd uses cpu_relax() in its sync_with_hw() function. Because cpu_relax() is defined as 'REP; NOP' on x86_64, it will block the CPU from servicing IOMMU PPR requests. This may cause a deadlock, because sync_with_hw() won't be completed until the PPR request has been served. Therefore, we need to use schedule() instead of cpu_relax() as it is the minimum requirement to allow other threads to execute. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
index 5055fc9c8731..9abac48de499 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
@@ -25,6 +25,7 @@
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/printk.h>
+#include <linux/sched.h>
#include "kfd_kernel_queue.h"
#include "kfd_priv.h"
#include "kfd_device_queue_manager.h"
@@ -274,7 +275,7 @@ static int sync_with_hw(struct kernel_queue *kq, unsigned long timeout_ms)
*kq->wptr_kernel, *kq->rptr_kernel);
return -ETIME;
}
- cpu_relax();
+ schedule();
}
return 0;