On 09/11/2026 13:55, Mika Kuoppala wrote:
A debugger connection can occur after a client has created and destroyed an arbitrary number of resources. To support this, we need to relay all currently existing resources to the debugger. The client is held on selected ioctls until this discovery process, run in the connect ioctl, is complete.Based on discovery work by Maciej Patelczyk for the i915 driver. v2: - use rw_semaphore to block DRM ioctls during discovery (Matthew) - only lock according to ioctl at play (Dominik) v4: - s/discovery_lock/ioctl_lock - change lock to be per xe_file as is connections v5: - helper to get eudebug instance during discovery (Maciej) v6: - complete_all even if no client (Sashiko) - don't flush on detach (Sashiko) v7: - guard close with ioctl lock (Sashiko) v8: - discovery lock comment fix (Maciej) v9: - disconnect on failed discovery (Sashiko) - avoid close race (Sashiko) v10: - unordered discovery workqueue (Sashiko) v11: - -EBUSY only from the ioctls that wait for discovery, keep -ENOTTY (review-prompts) v12: - discover in the connect ioctl, no worker, killable gate (Mika) v13: - exec queue uapi, helpers and exports moved to their users (Sashiko) - scoped ioctl_lock in attach, no goto next to __free() (Sashiko) Cc: Matthew Brost <[email protected]> Cc: Dominik Grzegorzek <[email protected]> Co-developed-by: Maciej Patelczyk <[email protected]> Signed-off-by: Maciej Patelczyk <[email protected]> Signed-off-by: Mika Kuoppala <[email protected]> Acked-by: Matthew Brost <[email protected]> #locking
Reviewed-by: Matthew Auld <[email protected]>
