drm/ttm: delay freeing of old node during move_memcpy until after iounmap
Drivers using their own implementation of io_mem_reserve/io_mem_free are likely to store the tracking information for the map in mem.mm_node, so it can't be freed while still mapped. Signed-off-by: Ben Skeggs<bskeggs@redhat.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
99ee7fac18
commit
b921bae2ee
|
@ -370,7 +370,6 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
|
||||||
}
|
}
|
||||||
mb();
|
mb();
|
||||||
out2:
|
out2:
|
||||||
ttm_bo_free_old_node(bo);
|
|
||||||
old_copy = *old_mem;
|
old_copy = *old_mem;
|
||||||
*old_mem = *new_mem;
|
*old_mem = *new_mem;
|
||||||
new_mem->mm_node = NULL;
|
new_mem->mm_node = NULL;
|
||||||
|
@ -385,6 +384,7 @@ out1:
|
||||||
ttm_mem_reg_iounmap(bdev, old_mem, new_iomap);
|
ttm_mem_reg_iounmap(bdev, old_mem, new_iomap);
|
||||||
out:
|
out:
|
||||||
ttm_mem_reg_iounmap(bdev, &old_copy, old_iomap);
|
ttm_mem_reg_iounmap(bdev, &old_copy, old_iomap);
|
||||||
|
ttm_bo_mem_put(bo, &old_copy);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(ttm_bo_move_memcpy);
|
EXPORT_SYMBOL(ttm_bo_move_memcpy);
|
||||||
|
|
Loading…
Reference in a new issue