Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/guc_submit: Make suspend_wait interruptible

Rely on wait_event_interruptible_timeout() to put the process to sleep
with TASK_INTERRUPTIBLE. It allows using this function in interruptible
context.

v2: Propagate error on wait_event_interruptible_timeout (Matt Brost)

Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809155156.1955925-3-francois.dugast@intel.com

authored by

Francois Dugast and committed by
Matthew Brost
3dc6da76 f784750c

+6 -6
+6 -6
drivers/gpu/drm/xe/xe_guc_submit.c
··· 1628 1628 * suspend_pending upon kill but to be paranoid but races in which 1629 1629 * suspend_pending is set after kill also check kill here. 1630 1630 */ 1631 - ret = wait_event_timeout(q->guc->suspend_wait, 1632 - !READ_ONCE(q->guc->suspend_pending) || 1633 - exec_queue_killed(q) || 1634 - guc_read_stopped(guc), 1635 - HZ * 5); 1631 + ret = wait_event_interruptible_timeout(q->guc->suspend_wait, 1632 + !READ_ONCE(q->guc->suspend_pending) || 1633 + exec_queue_killed(q) || 1634 + guc_read_stopped(guc), 1635 + HZ * 5); 1636 1636 1637 1637 if (!ret) { 1638 1638 xe_gt_warn(guc_to_gt(guc), ··· 1642 1642 return -ETIME; 1643 1643 } 1644 1644 1645 - return 0; 1645 + return ret < 0 ? ret : 0; 1646 1646 } 1647 1647 1648 1648 static void guc_exec_queue_resume(struct xe_exec_queue *q)