diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-25 09:51:30 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-25 10:13:34 +0100 |
commit | 65ca2566ffc8d186d094cc664526cdec5612b548 (patch) | |
tree | 690b83275984d1da4844078df6f2abb7d32d02e0 | |
parent | bf768299cb38404592f5f8189bd0e4bfaf3fa7c3 (diff) |
Revert "drm/ttm: make ttm_bo_unpin more defensive"
This reverts commit 0492006cc5ecb112d109a4b5cfa99798184a69e2 which is
commit 6c5403173a13a08ff61dbdafa4c0ed4a9dedbfe0 upstream.
It, and the following revert, are causing unneeded warnings to be sent
to the kernel log. For 5.11 these are not needed at this point in time.
Cc: Christian König <christian.koenig@amd.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Sasha Levin <sashal@kernel.org>
Link: https://lore.kernel.org/r/8c3da8bc-0bf3-496f-1fd6-4f65a07b2d13@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index b5bef3199196..79b9367e0ffd 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -613,11 +613,9 @@ static inline void ttm_bo_pin(struct ttm_buffer_object *bo) static inline void ttm_bo_unpin(struct ttm_buffer_object *bo) { dma_resv_assert_held(bo->base.resv); + WARN_ON_ONCE(!bo->pin_count); WARN_ON_ONCE(!kref_read(&bo->kref)); - if (bo->pin_count) - --bo->pin_count; - else - WARN_ON_ONCE(true); + --bo->pin_count; } int ttm_mem_evict_first(struct ttm_bo_device *bdev, |