Signal USERQ EOP EVENTFD subscriptions from the USERQ IRQ path. The IRQ flow already identifies the user queue associated with the EOP interrupt. Reuse that queue object to signal queue-scoped EVENTFD subscriptions through the user queue manager.
This avoids relying on queue_id or doorbell_index as internal routing keys and instead uses the actual queue object associated with the event. EVENTFD subscriptions hold references to queue objects, ensuring that notifications continue to target the intended queue without being affected by queue identifier reuse. This folds the earlier intermediate gfx11 EVENTFD hookup into the final queue-aware signaling path, so the series introduces the IRQ-side signaling only once. Signaling remains notification-only and uses plain eventfd_signal(ctx) once per matched occurrence. Changes in v10: - Replace queue_id-based EVENTFD routing with queue references. - Pass the actual queue object during USERQ_EOP signaling. Cc: Alex Deucher <[email protected]> Cc: Christian König <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c index 1941bfbcbfbf..9727da9c4224 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c @@ -26,6 +26,8 @@ #include <linux/module.h> #include <linux/pci.h> #include "amdgpu.h" +#include "amdgpu_userq.h" +#include "amdgpu_eventfd.h" #include "amdgpu_gfx.h" #include "amdgpu_psp.h" #include "amdgpu_smu.h" @@ -6488,7 +6490,23 @@ static int gfx_v11_0_eop_irq(struct amdgpu_device *adev, DRM_DEBUG("IH: CP EOP\n"); if (adev->enable_mes && doorbell_offset) { + struct amdgpu_usermode_queue *queue = NULL; + struct amdgpu_eventfd_mgr *eventfd_mgr; + struct xarray *xa = &adev->userq_doorbell_xa; + unsigned long flags; + amdgpu_userq_process_fence_irq(adev, doorbell_offset); + + xa_lock_irqsave(xa, flags); + queue = xa_load(xa, doorbell_offset); + if (queue) { + eventfd_mgr = amdgpu_userq_eventfd_mgr(queue->userq_mgr); + if (eventfd_mgr) + amdgpu_eventfd_signal(eventfd_mgr, + DRM_AMDGPU_EVENT_TYPE_USERQ_EOP, + queue); + } + xa_unlock_irqrestore(xa, flags); } else { me_id = (entry->ring_id & 0x0c) >> 2; pipe_id = (entry->ring_id & 0x03) >> 0; -- 2.34.1
