]> git.hungrycats.org Git - linux/commitdiff
drm/ttm: once more fix ttm_buffer_object_transfer
authorChristian König <christian.koenig@amd.com>
Mon, 30 Oct 2017 13:57:43 +0000 (14:57 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:42:13 +0000 (18:42 +0000)
commit 4d98e5ee6084f6d7bc578c5d5f86de7156aaa4cb upstream.

When the mutex is locked just in the moment we copy it we end up with a
warning that we release a locked mutex.

Fix this by properly reinitializing the mutex.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/gpu/drm/ttm/ttm_bo_util.c

index 1df856f7856821b31fe96e55dac5bc74bd74ed4b..2248cd68657fb978998b3e7f7be8b3ee0adf9414 100644 (file)
@@ -463,6 +463,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
        INIT_LIST_HEAD(&fbo->lru);
        INIT_LIST_HEAD(&fbo->swap);
        INIT_LIST_HEAD(&fbo->io_reserve_lru);
+       mutex_init(&fbo->wu_mutex);
        drm_vma_node_reset(&fbo->vma_node);
        atomic_set(&fbo->cpu_writers, 0);