Queue scratch/runtime error records into the WAIT_EVENT path. The INVALID_VA queue state is set when user queue restore finds that required VA mappings are no longer present. Reuse this point to emit a WAIT_EVENT scratch record.
The queue doorbell index is used as the queue identifier. Changes in v5: - Use queue->qid instead of doorbell_index for queue-scoped event handling (Alex) Cc: Alex Deucher <[email protected]> Cc: Christian König <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c index 1dd0d5f152af..8237e74d1c7f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c @@ -896,9 +896,9 @@ amdgpu_userq_restore_all(struct amdgpu_userq_mgr *uq_mgr) unsigned long queue_id; int ret = 0, r; - - if (amdgpu_bo_reserve(vm->root.bo, false)) - return false; + r = amdgpu_bo_reserve(vm->root.bo, false); + if (r) + return r; mutex_lock(&uq_mgr->userq_mutex); /* Resume all the queues for this process */ @@ -916,6 +916,16 @@ amdgpu_userq_restore_all(struct amdgpu_userq_mgr *uq_mgr) DRM_AMDGPU_EVENT_TYPE_SCRATCH, queue->qid); + if (queue->userq_mgr && + queue->userq_mgr->wait_event_mgr) + amdgpu_wait_event_push_scratch( + queue->userq_mgr->wait_event_mgr, + queue->qid, + 0, /* error_code */ + 0, /* requested_bytes */ + 0 /* available_bytes */ + ); + continue; } -- 2.34.1
