diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-12-15 23:47:46 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-12-15 23:47:46 -0500 |
commit | b921bae2eedc806b118a03d986cf0be9ffd3af40 (patch) | |
tree | e6df7453e393d7425f926064e3da1fb1489dad86 | |
parent | 99ee7fac189893c90145a22b86bbcfdc98f69a9c (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo_util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index a89839f83f6c..77dbf408c0d0 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c | |||
@@ -370,7 +370,6 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, | |||
370 | } | 370 | } |
371 | mb(); | 371 | mb(); |
372 | out2: | 372 | out2: |
373 | ttm_bo_free_old_node(bo); | ||
374 | old_copy = *old_mem; | 373 | old_copy = *old_mem; |
375 | *old_mem = *new_mem; | 374 | *old_mem = *new_mem; |
376 | new_mem->mm_node = NULL; | 375 | new_mem->mm_node = NULL; |
@@ -385,6 +384,7 @@ out1: | |||
385 | ttm_mem_reg_iounmap(bdev, old_mem, new_iomap); | 384 | ttm_mem_reg_iounmap(bdev, old_mem, new_iomap); |
386 | out: | 385 | out: |
387 | ttm_mem_reg_iounmap(bdev, &old_copy, old_iomap); | 386 | ttm_mem_reg_iounmap(bdev, &old_copy, old_iomap); |
387 | ttm_bo_mem_put(bo, &old_copy); | ||
388 | return ret; | 388 | return ret; |
389 | } | 389 | } |
390 | EXPORT_SYMBOL(ttm_bo_move_memcpy); | 390 | EXPORT_SYMBOL(ttm_bo_move_memcpy); |