mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
drm/ttm: make ttm_bo_unpin more defensive
commit6c5403173a
upstream. We seem to have some more driver bugs than thought. Signed-off-by: Christian König <christian.koenig@amd.com> Fixes:deb0814b43
("drm/ttm: add ttm_bo_pin()/ttm_bo_unpin() v2") Acked-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210312093810.2202-1-christian.koenig@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c0f2b2b020
commit
4148f28f98
1 changed files with 4 additions and 2 deletions
|
@ -628,8 +628,10 @@ 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);
|
||||
--bo->pin_count;
|
||||
if (bo->pin_count)
|
||||
--bo->pin_count;
|
||||
else
|
||||
WARN_ON_ONCE(true);
|
||||
}
|
||||
|
||||
int ttm_mem_evict_first(struct ttm_bo_device *bdev,
|
||||
|
|
Loading…
Reference in a new issue