> From: Winiarski, Michal <[email protected]> > Sent: Tuesday, November 11, 2025 9:05 AM > + > + /* > + * As the higher VFIO layers are holding locks across reset and using > + * those same locks with the mm_lock we need to prevent ABBA > deadlock > + * with the state_mutex and mm_lock. > + * In case the state_mutex was taken already we defer the cleanup > work > + * to the unlock flow of the other running context. > + */ > + spin_lock(&xe_vdev->reset_lock); > + xe_vdev->deferred_reset = true; > + if (!mutex_trylock(&xe_vdev->state_mutex)) { > + spin_unlock(&xe_vdev->reset_lock); > + return; > + } > + spin_unlock(&xe_vdev->reset_lock); > + xe_vfio_pci_state_mutex_unlock(xe_vdev); > + > + xe_vfio_pci_reset(xe_vdev); > +}
Jason suggested to do this in the core given it's common [1]. If you disagree, then please raise it and get consensus in that thread instead of rushing to post a new version... [1] https://lore.kernel.org/all/[email protected]/
