drm/xe: Add vm snapshot mutex for easily taking a vm snapshot during devcoredump
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 21 Feb 2024 13:30:20 +0000 (14:30 +0100)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 21 Feb 2024 19:08:23 +0000 (20:08 +0100)
commit0cd99046ca0522d8d212eb9adb093063a5f333ae
tree3f3a64c4ef449e87504415d37e8759ca705b89fe
parentffb7249df1998a623525648fca412e17a440a136
drm/xe: Add vm snapshot mutex for easily taking a vm snapshot during devcoredump

The devcoredump is done in fence signaling context. Because of this, we
cannot take any of the normal mutexes or we would invert.

Normal: Take vm->lock, dma_fence_wait()
Devcoredump: from dma_fence_wait() context, take vm->lock.

This doesn't work, and we only care about integrity, so take the locks
around additions and removals of vma's.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240221133024.898315-5-maarten.lankhorst@linux.intel.com
drivers/gpu/drm/xe/xe_vm.c
drivers/gpu/drm/xe/xe_vm_types.h