This is a note to let you know that I've just added the patch titled drm/radeon: wait for moving fence after pinning to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-radeon-wait-for-moving-fence-after-pinning.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 4b41726aae563273bb4b4a9462ba51ce4d372f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@xxxxxxx> Date: Mon, 21 Jun 2021 13:43:05 +0200 Subject: drm/radeon: wait for moving fence after pinning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Christian König <christian.koenig@xxxxxxx> commit 4b41726aae563273bb4b4a9462ba51ce4d372f78 upstream. We actually need to wait for the moving fence after pinning the BO to make sure that the pin is completed. Signed-off-by: Christian König <christian.koenig@xxxxxxx> Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx> References: https://lore.kernel.org/dri-devel/20210621151758.2347474-1-daniel.vetter@xxxxxxxx/ CC: stable@xxxxxxxxxx Link: https://patchwork.freedesktop.org/patch/msgid/20210622114506.106349-2-christian.koenig@xxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/radeon/radeon_prime.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/radeon/radeon_prime.c +++ b/drivers/gpu/drm/radeon/radeon_prime.c @@ -92,9 +92,19 @@ int radeon_gem_prime_pin(struct drm_gem_ /* pin buffer into GTT */ ret = radeon_bo_pin(bo, RADEON_GEM_DOMAIN_GTT, NULL); - if (likely(ret == 0)) - bo->prime_shared_count++; + if (unlikely(ret)) + goto error; + if (bo->tbo.moving) { + ret = dma_fence_wait(bo->tbo.moving, false); + if (unlikely(ret)) { + radeon_bo_unpin(bo); + goto error; + } + } + + bo->prime_shared_count++; +error: radeon_bo_unreserve(bo); return ret; } Patches currently in stable-queue which might be from christian.koenig@xxxxxxx are queue-4.19/radeon-use-memcpy_to-fromio-for-uvd-fw-upload.patch queue-4.19/drm-nouveau-wait-for-moving-fence-after-pinning-v2.patch queue-4.19/drm-radeon-wait-for-moving-fence-after-pinning.patch