mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
drm/amdkfd: fix the hang caused by the write reorder to fence_addr
make sure KFD_FENCE_INIT write to fence_addr before pm_send_query_status called, to avoid qcm fence timeout caused by incorrect ordering. Signed-off-by: Victor Zhao <Victor.Zhao@amd.com> Reviewed-by: Philip Yang <Philip.Yang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
9343b904e7
commit
8834456163
@@ -2048,7 +2048,7 @@ int amdkfd_fence_wait_timeout(struct device_queue_manager *dqm,
|
||||
{
|
||||
unsigned long end_jiffies = msecs_to_jiffies(timeout_ms) + jiffies;
|
||||
struct device *dev = dqm->dev->adev->dev;
|
||||
uint64_t *fence_addr = dqm->fence_addr;
|
||||
volatile uint64_t *fence_addr = dqm->fence_addr;
|
||||
|
||||
while (*fence_addr != fence_value) {
|
||||
/* Fatal err detected, this response won't come */
|
||||
@@ -2254,6 +2254,7 @@ static int unmap_queues_cpsch(struct device_queue_manager *dqm,
|
||||
goto out;
|
||||
|
||||
*dqm->fence_addr = KFD_FENCE_INIT;
|
||||
mb();
|
||||
pm_send_query_status(&dqm->packet_mgr, dqm->fence_gpu_addr,
|
||||
KFD_FENCE_COMPLETED);
|
||||
/* should be timed out */
|
||||
|
||||
@@ -260,7 +260,7 @@ struct device_queue_manager {
|
||||
uint16_t vmid_pasid[VMID_NUM];
|
||||
uint64_t pipelines_addr;
|
||||
uint64_t fence_gpu_addr;
|
||||
uint64_t *fence_addr;
|
||||
volatile uint64_t *fence_addr;
|
||||
struct kfd_mem_obj *fence_mem;
|
||||
bool active_runlist;
|
||||
int sched_policy;
|
||||
|
||||
Reference in New Issue
Block a user