dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/ttm: fix busy reference in ttm_mem_evict_first
@ 2019-09-25 10:55 Christian König
  2019-09-25 10:55 ` [PATCH 2/3] drm/ttm: always keep BOs on the LRU Christian König
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Christian König @ 2019-09-25 10:55 UTC (permalink / raw)
  To: kraxel, daniel, thomas_os, dri-devel

The busy BO might actually be already deleted,
so grab only a list reference.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 881cf26d698e..02f301e1ff29 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -875,11 +875,11 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
 
 	if (!bo) {
 		if (busy_bo)
-			ttm_bo_get(busy_bo);
+			kref_get(&busy_bo->list_kref);
 		spin_unlock(&glob->lru_lock);
 		ret = ttm_mem_evict_wait_busy(busy_bo, ctx, ticket);
 		if (busy_bo)
-			ttm_bo_put(busy_bo);
+			kref_put(&busy_bo->list_kref, ttm_bo_release_list);
 		return ret;
 	}
 
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-10-21 12:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-25 10:55 [PATCH 1/3] drm/ttm: fix busy reference in ttm_mem_evict_first Christian König
2019-09-25 10:55 ` [PATCH 2/3] drm/ttm: always keep BOs on the LRU Christian König
2019-09-25 12:06   ` Thomas Hellström (VMware)
2019-09-25 12:10     ` Christian König
2019-10-16  9:30       ` Christian König
2019-10-18 13:49         ` Thomas Hellström (VMware)
2019-10-21 12:27           ` Thomas Hellström (VMware)
2019-09-25 10:55 ` [PATCH 3/3] drm/ttm: remove pointers to globals Christian König
2019-09-25 11:56   ` Thomas Hellström (VMware)
2019-09-25 11:55 ` [PATCH 1/3] drm/ttm: fix busy reference in ttm_mem_evict_first Thomas Hellström (VMware)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).