Skip to content

Commit bec771b

Browse files
committed
Revert "drm/ttm: Warn on pinning without holding a reference"
This reverts commit 7d09e97 which is commit 57fcd55 upstream. It is causing too many warnings on 5.11.y, so should be dropped for now. Cc: Huang Rui <ray.huang@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Christian Koenig <christian.koenig@amd.com> Cc: Huang Rui <ray.huang@amd.com> Cc: Sasha Levin <sashal@kernel.org> Reported-by: Oleksandr Natalenko <oleksandr@natalenko.name> Link: https://lore.kernel.org/r/8c3da8bc-0bf3-496f-1fd6-4f65a07b2d13@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 65ca256 commit bec771b

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

‎drivers/gpu/drm/ttm/ttm_bo.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static void ttm_bo_release(struct kref *kref)
514514
* shrinkers, now that they are queued for
515515
* destruction.
516516
*/
517-
if (WARN_ON(bo->pin_count)) {
517+
if (bo->pin_count) {
518518
bo->pin_count = 0;
519519
ttm_bo_del_from_lru(bo);
520520
ttm_bo_add_mem_to_lru(bo, &bo->mem);

‎include/drm/ttm/ttm_bo_api.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ static inline bool ttm_bo_uses_embedded_gem_object(struct ttm_buffer_object *bo)
600600
static inline void ttm_bo_pin(struct ttm_buffer_object *bo)
601601
{
602602
dma_resv_assert_held(bo->base.resv);
603-
WARN_ON_ONCE(!kref_read(&bo->kref));
604603
++bo->pin_count;
605604
}
606605

@@ -614,7 +613,6 @@ static inline void ttm_bo_unpin(struct ttm_buffer_object *bo)
614613
{
615614
dma_resv_assert_held(bo->base.resv);
616615
WARN_ON_ONCE(!bo->pin_count);
617-
WARN_ON_ONCE(!kref_read(&bo->kref));
618616
--bo->pin_count;
619617
}
620618

0 commit comments

Comments
 (0)