projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de066e1
)
drm/ttm: make ttm_bo_unpin more defensive
author
Christian König
<christian.koenig@amd.com>
Fri, 12 Mar 2021 08:34:39 +0000
(09:34 +0100)
committer
Christian König
<christian.koenig@amd.com>
Mon, 15 Mar 2021 15:02:30 +0000
(16:02 +0100)
We seem to have some more driver bugs than thought.
Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: deb0814b43f3 ("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
include/drm/ttm/ttm_bo_api.h
patch
|
blob
|
history
diff --git
a/include/drm/ttm/ttm_bo_api.h
b/include/drm/ttm/ttm_bo_api.h
index e17be324d95f5d47aa00af1242192febdbc63dff..b8ca13664fa20e6cfb57576a1689cd866691bd4d 100644
(file)
--- a/
include/drm/ttm/ttm_bo_api.h
+++ b/
include/drm/ttm/ttm_bo_api.h
@@
-612,9
+612,11
@@
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));
- --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,