On 2026-06-18 08:11, Sunil Khatri wrote:
With KGD userqueues the VMID's could overlap for userqueues
and KFD queues and due to which SQ interrupts of KGD process
are routed to KFD interrupt handlers.
To avoid Noise of SQ interrupt for KGD user queues use the pasid
id's to identify the non KFD processes and return without any
interrupt processing in WQ.
Signed-off-by: Sunil Khatri <[email protected]>
The patch series looks reasonable. But now every interrupt needs to look
up the process from pasid twice. It's not very efficient because that
lookup is currently a linear search. A bike-shedding suggestion:
Keep the kfd_process reference for the whole interrupt handling function
and pass it to the different signaling functions instead of the pasid so
they don't need to repeat the lookup.
Regards,
Felix
---
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v12_1.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v12_1.c
b/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v12_1.c
index 0da7e1db55c9..e02f63c0c845 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v12_1.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v12_1.c
@@ -296,6 +296,7 @@ static bool event_interrupt_isr_v12_1(struct kfd_node *node,
static void event_interrupt_wq_v12_1(struct kfd_node *node,
const uint32_t *ih_ring_entry)
{
+ struct kfd_process *p;
uint16_t source_id, client_id, ring_id, pasid, vmid;
uint32_t context_id0, context_id1;
uint8_t sq_int_enc, sq_int_priv, sq_int_errtype;
@@ -310,6 +311,14 @@ static void event_interrupt_wq_v12_1(struct kfd_node *node,
context_id0 = SOC15_CONTEXT_ID0_FROM_IH_ENTRY(ih_ring_entry);
context_id1 = SOC15_CONTEXT_ID1_FROM_IH_ENTRY(ih_ring_entry);
+ if (source_id == SOC15_INTSRC_SQ_INTERRUPT_MSG) {
+ p = kfd_lookup_process_by_pasid(pasid, NULL);
+ if (!p)
+ return;
+
+ kfd_unref_process(p);
+ }
+
/* VMC, UTCL2 */
if (client_id == SOC21_IH_CLIENTID_VMC ||
client_id == SOC21_IH_CLIENTID_UTCL2) {