• Matthew Auld's avatar
    drm/xe/vm: fix double list add · dbd6c64c
    Matthew Auld authored
    It looks like the driver only wants to track one vma for each external
    object per vm. However it looks like bo_has_vm_references_locked() will
    ignore any vma that is marked as vma->destroyed (not actually destroyed
    yet). If we then mark our externally tracked vma as destroyed and then
    create a new vma for the same object and vm, we can have two externally
    tracked vma for the same object and vm. When the destroy actually
    happens it tries to move the external tracking to a different vma, but
    in this case it is already being tracked, leading to double list add
    errors. It should be safe to simply drop the destroyed check in
    bo_has_vm_references(), since the actual destroy will switch the
    external tracking to the next available vma.
    
    Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/290
    Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
    Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
    dbd6c64c
xe_vm.c 82 KB