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

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe: Drop EXEC_QUEUE_FLAG_BANNED

Clean up laying violation of setting q->flags EXEC_QUEUE_FLAG_BANNED bit
in GuC backend. Move banned to GuC owned bit and report banned status to
upper layers via reset_status vfunc. This is a slight change in behavior
as reset_status returns true if wedged or killed bits set too, but in
all of these cases submission to queue is no longer allowed.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240604184700.1946918-1-matthew.brost@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

authored by

Matthew Brost and committed by
Rodrigo Vivi
4468d048 7ecea18e

+13 -13
+1 -1
drivers/gpu/drm/xe/xe_exec.c
··· 141 141 q->width != args->num_batch_buffer)) 142 142 return -EINVAL; 143 143 144 - if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_BANNED)) { 144 + if (XE_IOCTL_DBG(xe, q->ops->reset_status(q))) { 145 145 err = -ECANCELED; 146 146 goto err_exec_queue; 147 147 }
+1 -1
drivers/gpu/drm/xe/xe_exec_queue.c
··· 677 677 678 678 switch (args->property) { 679 679 case DRM_XE_EXEC_QUEUE_GET_PROPERTY_BAN: 680 - args->value = !!(q->flags & EXEC_QUEUE_FLAG_BANNED); 680 + args->value = q->ops->reset_status(q); 681 681 ret = 0; 682 682 break; 683 683 default:
+5 -7
drivers/gpu/drm/xe/xe_exec_queue_types.h
··· 70 70 */ 71 71 struct dma_fence *last_fence; 72 72 73 - /* queue no longer allowed to submit */ 74 - #define EXEC_QUEUE_FLAG_BANNED BIT(0) 75 73 /* queue used for kernel submission only */ 76 - #define EXEC_QUEUE_FLAG_KERNEL BIT(1) 74 + #define EXEC_QUEUE_FLAG_KERNEL BIT(0) 77 75 /* kernel engine only destroyed at driver unload */ 78 - #define EXEC_QUEUE_FLAG_PERMANENT BIT(2) 76 + #define EXEC_QUEUE_FLAG_PERMANENT BIT(1) 79 77 /* for VM jobs. Caller needs to hold rpm ref when creating queue with this flag */ 80 - #define EXEC_QUEUE_FLAG_VM BIT(3) 78 + #define EXEC_QUEUE_FLAG_VM BIT(2) 81 79 /* child of VM queue for multi-tile VM jobs */ 82 - #define EXEC_QUEUE_FLAG_BIND_ENGINE_CHILD BIT(4) 80 + #define EXEC_QUEUE_FLAG_BIND_ENGINE_CHILD BIT(3) 83 81 /* kernel exec_queue only, set priority to highest level */ 84 - #define EXEC_QUEUE_FLAG_HIGH_PRIORITY BIT(5) 82 + #define EXEC_QUEUE_FLAG_HIGH_PRIORITY BIT(4) 85 83 86 84 /** 87 85 * @flags: flags for this exec queue, should statically setup aside from ban
+6 -4
drivers/gpu/drm/xe/xe_guc_submit.c
··· 61 61 #define EXEC_QUEUE_STATE_RESET (1 << 6) 62 62 #define EXEC_QUEUE_STATE_KILLED (1 << 7) 63 63 #define EXEC_QUEUE_STATE_WEDGED (1 << 8) 64 + #define EXEC_QUEUE_STATE_BANNED (1 << 9) 64 65 65 66 static bool exec_queue_registered(struct xe_exec_queue *q) 66 67 { ··· 135 134 136 135 static bool exec_queue_banned(struct xe_exec_queue *q) 137 136 { 138 - return (q->flags & EXEC_QUEUE_FLAG_BANNED); 137 + return atomic_read(&q->guc->state) & EXEC_QUEUE_STATE_BANNED; 139 138 } 140 139 141 140 static void set_exec_queue_banned(struct xe_exec_queue *q) 142 141 { 143 - q->flags |= EXEC_QUEUE_FLAG_BANNED; 142 + atomic_or(EXEC_QUEUE_STATE_BANNED, &q->guc->state); 144 143 } 145 144 146 145 static bool exec_queue_suspended(struct xe_exec_queue *q) ··· 190 189 191 190 static bool exec_queue_killed_or_banned_or_wedged(struct xe_exec_queue *q) 192 191 { 193 - return exec_queue_banned(q) || (atomic_read(&q->guc->state) & 194 - (EXEC_QUEUE_STATE_WEDGED | EXEC_QUEUE_STATE_KILLED)); 192 + return (atomic_read(&q->guc->state) & 193 + (EXEC_QUEUE_STATE_WEDGED | EXEC_QUEUE_STATE_KILLED | 194 + EXEC_QUEUE_STATE_BANNED)); 195 195 } 196 196 197 197 #ifdef CONFIG_PROVE_LOCKING