summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-12-16 14:47:46 +1000
committerDave Airlie <airlied@redhat.com>2010-12-16 14:47:46 +1000
commitb921bae2eedc806b118a03d986cf0be9ffd3af40 (patch)
treee6df7453e393d7425f926064e3da1fb1489dad86 /drivers/gpu/drm/ttm
parent99ee7fac189893c90145a22b86bbcfdc98f69a9c (diff)
downloadlwn-b921bae2eedc806b118a03d986cf0be9ffd3af40.tar.gz
lwn-b921bae2eedc806b118a03d986cf0be9ffd3af40.zip
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>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c2
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,
}
mb();
out2:
- ttm_bo_free_old_node(bo);
old_copy = *old_mem;
*old_mem = *new_mem;
new_mem->mm_node = NULL;
@@ -385,6 +384,7 @@ out1:
ttm_mem_reg_iounmap(bdev, old_mem, new_iomap);
out:
ttm_mem_reg_iounmap(bdev, &old_copy, old_iomap);
+ ttm_bo_mem_put(bo, &old_copy);
return ret;
}
EXPORT_SYMBOL(ttm_bo_move_memcpy);