/* Used when a CT send wants to block and / or receive data */
struct g2h_fence {
- wait_queue_head_t wq;
u32 *response_buffer;
u32 seqno;
u16 response_len;
ct->fence_context = dma_fence_context_alloc(1);
INIT_WORK(&ct->g2h_worker, g2h_worker_func);
init_waitqueue_head(&ct->wq);
+ init_waitqueue_head(&ct->g2h_fence_wq);
primelockdep(ct);
void *ptr;
g2h_fence->seqno = (ct->fence_seqno++ & 0xffff);
- init_waitqueue_head(&g2h_fence->wq);
ptr = xa_store(&ct->fence_lookup,
g2h_fence->seqno,
g2h_fence, GFP_ATOMIC);
return ret;
}
- ret = wait_event_timeout(g2h_fence.wq, g2h_fence.done, HZ);
+ ret = wait_event_timeout(ct->g2h_fence_wq, g2h_fence.done, HZ);
if (!ret) {
drm_err(&xe->drm, "Timed out wait for G2H, fence %u, action %04x",
g2h_fence.seqno, action[0]);
g2h_fence->done = true;
smp_mb();
- wake_up(&g2h_fence->wq);
+ wake_up_all(&ct->g2h_fence_wq);
return 0;
}
struct xarray fence_lookup;
/** @wq: wait queue used for reliable CT sends and freeing G2H credits */
wait_queue_head_t wq;
+ /** @g2h_fence_wq: wait queue used for G2H fencing */
+ wait_queue_head_t g2h_fence_wq;
#ifdef XE_GUC_CT_SELFTEST
/** @suppress_irq_handler: force flow control to sender */
bool suppress_irq_handler;