Signal SCRATCH EVENTFD subscriptions when user queue restore detects
missing VA mappings.

The restore path already identifies the affected user queue. Use that
queue object to wake up the matching EVENTFD subscribers.

SCRATCH is queue-scoped, so the queue object is used for signaling.

EVENTFD remains notification-only.

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 | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index b77385e35e4e..7f605501c84c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -896,7 +896,6 @@ 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;
 
@@ -905,9 +904,17 @@ amdgpu_userq_restore_all(struct amdgpu_userq_mgr *uq_mgr)
        xa_for_each(&uq_mgr->userq_xa, queue_id, queue) {
 
                if (!amdgpu_userq_buffer_vas_mapped(queue)) {
+                       struct amdgpu_eventfd_mgr *eventfd_mgr;
+
                        drm_file_err(uq_mgr->file,
                                     "trying restore queue without va 
mapping\n");
                        queue->state = AMDGPU_USERQ_STATE_INVALID_VA;
+
+                       eventfd_mgr = 
amdgpu_userq_eventfd_mgr(queue->userq_mgr);
+                       amdgpu_eventfd_signal(eventfd_mgr,
+                                             DRM_AMDGPU_EVENT_TYPE_SCRATCH,
+                                             queue);
+
                        continue;
                }
 
-- 
2.34.1

Reply via email to