dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/ttm: fix false positive assert
@ 2020-03-06 12:41 Christian König
  2020-03-09 11:49 ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2020-03-06 12:41 UTC (permalink / raw)
  To: Pierre-eric.Pelloux-prayer, dri-devel

The assert sometimes incorrectly triggers when pinned BOs are destroyed.

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

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 2445e2bd6267..ca5a8d01ff1f 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -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);
-- 
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] 4+ messages in thread

* Re: [PATCH] drm/ttm: fix false positive assert
  2020-03-06 12:41 [PATCH] drm/ttm: fix false positive assert Christian König
@ 2020-03-09 11:49 ` Christian König
  2020-03-10  2:17   ` Huang Rui
  2020-03-10  7:44   ` Pierre-Eric Pelloux-Prayer
  0 siblings, 2 replies; 4+ messages in thread
From: Christian König @ 2020-03-09 11:49 UTC (permalink / raw)
  To: Pierre-eric.Pelloux-prayer, dri-devel, Huang Rui

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:
> The assert sometimes incorrectly triggers when pinned BOs are destroyed.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 2445e2bd6267..ca5a8d01ff1f 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -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);

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

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

* Re: [PATCH] drm/ttm: fix false positive assert
  2020-03-09 11:49 ` Christian König
@ 2020-03-10  2:17   ` Huang Rui
  2020-03-10  7:44   ` Pierre-Eric Pelloux-Prayer
  1 sibling, 0 replies; 4+ messages in thread
From: Huang Rui @ 2020-03-10  2:17 UTC (permalink / raw)
  To: Christian König; +Cc: Pelloux-prayer, Pierre-eric, dri-devel

On Mon, Mar 09, 2020 at 07:49:15PM +0800, Christian König wrote:
> 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:
> > The assert sometimes incorrectly triggers when pinned BOs are destroyed.
> >
> > Signed-off-by: Christian König <christian.koenig@amd.com>

Reviewed-by: Huang Rui <ray.huang@amd.com>

> > ---
> >   drivers/gpu/drm/ttm/ttm_bo.c | 5 ++---
> >   1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> > index 2445e2bd6267..ca5a8d01ff1f 100644
> > --- a/drivers/gpu/drm/ttm/ttm_bo.c
> > +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> > @@ -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);
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/ttm: fix false positive assert
  2020-03-09 11:49 ` Christian König
  2020-03-10  2:17   ` Huang Rui
@ 2020-03-10  7:44   ` Pierre-Eric Pelloux-Prayer
  1 sibling, 0 replies; 4+ messages in thread
From: Pierre-Eric Pelloux-Prayer @ 2020-03-10  7:44 UTC (permalink / raw)
  To: Christian König, dri-devel, Huang Rui

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

On 09/03/2020 12:49, Christian König wrote:
> 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:
>> The assert sometimes incorrectly triggers when pinned BOs are destroyed.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>   drivers/gpu/drm/ttm/ttm_bo.c | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
>> index 2445e2bd6267..ca5a8d01ff1f 100644
>> --- a/drivers/gpu/drm/ttm/ttm_bo.c
>> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
>> @@ -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);
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2020-03-10  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 12:41 [PATCH] drm/ttm: fix false positive assert Christian König
2020-03-09 11:49 ` Christian König
2020-03-10  2:17   ` Huang Rui
2020-03-10  7:44   ` Pierre-Eric Pelloux-Prayer

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).