Skip to contentSkip to conversation

drm/ttm: fix false positive assert

PATCH In review Christian König 3 participants 4 messages Mar 6, 2020 – Mar 10, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: fix false positive assert

The assert sometimes incorrectly triggers when pinned BOs are destroyed.

---
 drivers/gpu/drm/ttm/ttm_bo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -3
index 2445e2bd6267..ca5a8d01ff1f 100644
@@ -151,8 +151,6 @@ static void ttm_bo_add_mem_to_lru(struct ttm_buffer_object *bo,
 	struct ttm_bo_device *bdev = bo->bdev;
 	struct ttm_mem_type_manager *man;
 
-	dma_resv_assert_held(bo->base.resv);
-
 	if (!list_empty(&bo->lru))
 		return;
 
@@ -611,7 +609,8 @@ static void ttm_bo_release(struct kref *kref)
 		 */
 		if (bo->mem.placement & TTM_PL_FLAG_NO_EVICT) {
 			bo->mem.placement &= ~TTM_PL_FLAG_NO_EVICT;
-			ttm_bo_move_to_lru_tail(bo, NULL);
+			ttm_bo_del_from_lru(bo);
+			ttm_bo_add_mem_to_lru(bo, &bo->mem);
 		}
 
 		kref_init(&bo->kref);
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Pierre-eric, just a gentle ping on this? Could I get a tested-by?

Ray can you ack or even review this?

Thanks,
Christian.

Am 06.03.20 um 13:41 schrieb Christian König:

Quoted 21 lines

The assert sometimes incorrectly triggers when pinned BOs are destroyed.

---
  drivers/gpu/drm/ttm/ttm_bo.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +0 -2
index 2445e2bd6267..ca5a8d01ff1f 100644
@@ -151,8 +151,6 @@ static void ttm_bo_add_mem_to_lru(struct ttm_buffer_object *bo,
  	struct ttm_bo_device *bdev = bo->bdev;
  	struct ttm_mem_type_manager *man;
 
-	dma_resv_assert_held(bo->base.resv);
-
  	if (!list_empty(&bo->lru))
  		return;
 

drivers/gpu/drm/ttm/ttm_bo.c static void ttm_bo_release(struct kref *kref) · line 616

Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
@@ -611,7 +609,8 @@ static void ttm_bo_release(struct kref *kref)
  		 */
  		if (bo->mem.placement & TTM_PL_FLAG_NO_EVICT) {
  			bo->mem.placement &= ~TTM_PL_FLAG_NO_EVICT;
-			ttm_bo_move_to_lru_tail(bo, NULL);
+			ttm_bo_del_from_lru(bo);
+			ttm_bo_add_mem_to_lru(bo, &bo->mem);
  		}
 
  		kref_init(&bo->kref);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by
#2 lore raw
Quoted 11 lines · Christian König

Pierre-eric, just a gentle ping on this? Could I get a tested-by?

Ray can you ack or even review this?

Thanks,
Christian.

Am 06.03.20 um 13:41 schrieb Christian König:

Quoted 3 lines

The assert sometimes incorrectly triggers when pinned BOs are destroyed.

Quoted 26 lines
Quoted 26 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -3
index 2445e2bd6267..ca5a8d01ff1f 100644
@@ -151,8 +151,6 @@ static void ttm_bo_add_mem_to_lru(struct ttm_buffer_object *bo,
  	struct ttm_bo_device *bdev = bo->bdev;
  	struct ttm_mem_type_manager *man;
 
-	dma_resv_assert_held(bo->base.resv);
-
  	if (!list_empty(&bo->lru))
  		return;
 
@@ -611,7 +609,8 @@ static void ttm_bo_release(struct kref *kref)
  		 */
  		if (bo->mem.placement & TTM_PL_FLAG_NO_EVICT) {
  			bo->mem.placement &= ~TTM_PL_FLAG_NO_EVICT;
-			ttm_bo_move_to_lru_tail(bo, NULL);
+			ttm_bo_del_from_lru(bo);
+			ttm_bo_add_mem_to_lru(bo, &bo->mem);
  		}
 
Quoted 2 lines

drivers/gpu/drm/ttm/ttm_bo.c static void ttm_bo_release(struct kref *kref) · line 616

Quoted 1 line
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
  		kref_init(&bo->kref);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to Christian König

Hi Christian,

Sorry I missed your original email. I just tested the patch and it works fine, so feel free to add my Tested-by tag.

Pierre-Eric

Quoted 32 lines · Christian König

Pierre-eric, just a gentle ping on this? Could I get a tested-by?

Ray can you ack or even review this?

Thanks,
Christian.

Am 06.03.20 um 13:41 schrieb Christian König:

Quoted 24 lines

The assert sometimes incorrectly triggers when pinned BOs are destroyed.

---
  drivers/gpu/drm/ttm/ttm_bo.c | 5 ++---

  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +0 -1
index 2445e2bd6267..ca5a8d01ff1f 100644
@@ -151,8 +151,6 @@ static void ttm_bo_add_mem_to_lru(struct ttm_buffer_object *bo,
       struct ttm_bo_device *bdev = bo->bdev;
       struct ttm_mem_type_manager *man;
   -    dma_resv_assert_held(bo->base.resv);
-
       if (!list_empty(&bo->lru))
           return;
   @@ -611,7 +609,8 @@ static void ttm_bo_release(struct kref *kref)

           */
          if (bo->mem.placement & TTM_PL_FLAG_NO_EVICT) { bo->mem.placement &= ~TTM_PL_FLAG_NO_EVICT; -            ttm_bo_move_to_lru_tail(bo, NULL); +            ttm_bo_del_from_lru(bo);

Quoted 8 lines
Quoted 3 lines

+            ttm_bo_add_mem_to_lru(bo, &bo->mem);
          }
            kref_init(&bo->kref);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel