This is a note to let you know that I've just added the patch titled Revert "drm/ttm: Warn on pinning without holding a reference" to the 5.11-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: revert-drm-ttm-warn-on-pinning-without-holding-a.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 32b39ecbca3c922ca95b9ef3075b62c09e1fb4ea Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Date: Thu, 25 Mar 2021 09:52:40 +0100 Subject: Revert "drm/ttm: Warn on pinning without holding a reference" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> This reverts commit 7d09e9725b5dcc8d14e101de931e4969d033a6ad which is commit 57fcd550eb15bce14a7154736379dfd4ed60ae81 upstream. It is causing too many warnings on 5.11.y, so should be dropped for now. Cc: Huang Rui <ray.huang@xxxxxxx> Cc: Christian König <christian.koenig@xxxxxxx> Cc: Daniel Vetter <daniel.vetter@xxxxxxxxx> Cc: Christian Koenig <christian.koenig@xxxxxxx> Cc: Huang Rui <ray.huang@xxxxxxx> Cc: Sasha Levin <sashal@xxxxxxxxxx> Reported-by: Oleksandr Natalenko <oleksandr@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/8c3da8bc-0bf3-496f-1fd6-4f65a07b2d13@xxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/ttm/ttm_bo.c | 2 +- include/drm/ttm/ttm_bo_api.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -514,7 +514,7 @@ static void ttm_bo_release(struct kref * * shrinkers, now that they are queued for * destruction. */ - if (WARN_ON(bo->pin_count)) { + if (bo->pin_count) { bo->pin_count = 0; ttm_bo_del_from_lru(bo); ttm_bo_add_mem_to_lru(bo, &bo->mem); --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -600,7 +600,6 @@ static inline bool ttm_bo_uses_embedded_ static inline void ttm_bo_pin(struct ttm_buffer_object *bo) { dma_resv_assert_held(bo->base.resv); - WARN_ON_ONCE(!kref_read(&bo->kref)); ++bo->pin_count; } @@ -614,7 +613,6 @@ static inline void ttm_bo_unpin(struct t { dma_resv_assert_held(bo->base.resv); WARN_ON_ONCE(!bo->pin_count); - WARN_ON_ONCE(!kref_read(&bo->kref)); --bo->pin_count; } Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are queue-5.11/revert-drm-ttm-make-ttm_bo_unpin-more-defensive.patch queue-5.11/revert-drm-ttm-warn-on-pinning-without-holding-a.patch