dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/ttm: cleanup the resource of ghost objects after locking them
@ 2022-09-07 10:00 Christian König
  2022-09-07 10:10 ` Matthew Auld
  2022-09-07 10:26 ` Matthew Auld
  0 siblings, 2 replies; 5+ messages in thread
From: Christian König @ 2022-09-07 10:00 UTC (permalink / raw)
  To: matthew.william.auld, zhenguo.yin, dri-devel, jingwen.chen2
  Cc: Christian König

Otherwise lockdep will complain about cleaning up the bulk_move.

Not even compile tested.

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

diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 57a27847206f..911141d16e95 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -236,6 +236,11 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
 	if (bo->type != ttm_bo_type_sg)
 		fbo->base.base.resv = &fbo->base.base._resv;
 
+	dma_resv_init(&fbo->base.base._resv);
+	fbo->base.base.dev = NULL;
+	ret = dma_resv_trylock(&fbo->base.base._resv);
+	WARN_ON(!ret);
+
 	if (fbo->base.resource) {
 		ttm_resource_set_bo(fbo->base.resource, &fbo->base);
 		bo->resource = NULL;
@@ -244,11 +249,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
 		fbo->base.bulk_move = NULL;
 	}
 
-	dma_resv_init(&fbo->base.base._resv);
-	fbo->base.base.dev = NULL;
-	ret = dma_resv_trylock(&fbo->base.base._resv);
-	WARN_ON(!ret);
-
 	ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1);
 	if (ret) {
 		kfree(fbo);
-- 
2.25.1


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

* Re: [PATCH] drm/ttm: cleanup the resource of ghost objects after locking them
  2022-09-07 10:00 [PATCH] drm/ttm: cleanup the resource of ghost objects after locking them Christian König
@ 2022-09-07 10:10 ` Matthew Auld
  2022-09-07 10:26 ` Matthew Auld
  1 sibling, 0 replies; 5+ messages in thread
From: Matthew Auld @ 2022-09-07 10:10 UTC (permalink / raw)
  To: Christian König
  Cc: zhenguo.yin, jingwen.chen2, Christian König, ML dri-devel

On Wed, 7 Sept 2022 at 11:00, Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Otherwise lockdep will complain about cleaning up the bulk_move.
>
> Not even compile tested.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Can we quickly resend with --cc=intel-gfx@lists.freedesktop.org to
trigger a CI run? It will even compile test it for you, and confirm if
this fixes the issue or not :)

> ---
>  drivers/gpu/drm/ttm/ttm_bo_util.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index 57a27847206f..911141d16e95 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -236,6 +236,11 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
>         if (bo->type != ttm_bo_type_sg)
>                 fbo->base.base.resv = &fbo->base.base._resv;
>
> +       dma_resv_init(&fbo->base.base._resv);
> +       fbo->base.base.dev = NULL;
> +       ret = dma_resv_trylock(&fbo->base.base._resv);
> +       WARN_ON(!ret);
> +
>         if (fbo->base.resource) {
>                 ttm_resource_set_bo(fbo->base.resource, &fbo->base);
>                 bo->resource = NULL;
> @@ -244,11 +249,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
>                 fbo->base.bulk_move = NULL;
>         }
>
> -       dma_resv_init(&fbo->base.base._resv);
> -       fbo->base.base.dev = NULL;
> -       ret = dma_resv_trylock(&fbo->base.base._resv);
> -       WARN_ON(!ret);
> -
>         ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1);
>         if (ret) {
>                 kfree(fbo);
> --
> 2.25.1
>

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

* Re: [PATCH] drm/ttm: cleanup the resource of ghost objects after locking them
  2022-09-07 10:00 [PATCH] drm/ttm: cleanup the resource of ghost objects after locking them Christian König
  2022-09-07 10:10 ` Matthew Auld
@ 2022-09-07 10:26 ` Matthew Auld
  2022-09-08  7:46   ` Matthew Auld
  1 sibling, 1 reply; 5+ messages in thread
From: Matthew Auld @ 2022-09-07 10:26 UTC (permalink / raw)
  To: Christian König
  Cc: zhenguo.yin, jingwen.chen2, Christian König, ML dri-devel

On Wed, 7 Sept 2022 at 11:00, Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Otherwise lockdep will complain about cleaning up the bulk_move.
>
> Not even compile tested.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Looks reasonable to me,
Reviewed-by: Matthew Auld <matthew.auld@intel.com>

> ---
>  drivers/gpu/drm/ttm/ttm_bo_util.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index 57a27847206f..911141d16e95 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -236,6 +236,11 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
>         if (bo->type != ttm_bo_type_sg)
>                 fbo->base.base.resv = &fbo->base.base._resv;
>
> +       dma_resv_init(&fbo->base.base._resv);
> +       fbo->base.base.dev = NULL;
> +       ret = dma_resv_trylock(&fbo->base.base._resv);
> +       WARN_ON(!ret);
> +
>         if (fbo->base.resource) {
>                 ttm_resource_set_bo(fbo->base.resource, &fbo->base);
>                 bo->resource = NULL;
> @@ -244,11 +249,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
>                 fbo->base.bulk_move = NULL;
>         }
>
> -       dma_resv_init(&fbo->base.base._resv);
> -       fbo->base.base.dev = NULL;
> -       ret = dma_resv_trylock(&fbo->base.base._resv);
> -       WARN_ON(!ret);
> -
>         ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1);
>         if (ret) {
>                 kfree(fbo);
> --
> 2.25.1
>

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

* Re: [PATCH] drm/ttm: cleanup the resource of ghost objects after locking them
  2022-09-07 10:26 ` Matthew Auld
@ 2022-09-08  7:46   ` Matthew Auld
  2022-09-08  7:51     ` Christian König
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Auld @ 2022-09-08  7:46 UTC (permalink / raw)
  To: Christian König
  Cc: ZhenGuo Yin, jingwen.chen2, Christian König, ML dri-devel

On Wed, 7 Sept 2022 at 11:26, Matthew Auld
<matthew.william.auld@gmail.com> wrote:
>
> On Wed, 7 Sept 2022 at 11:00, Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
> >
> > Otherwise lockdep will complain about cleaning up the bulk_move.
> >
> > Not even compile tested.
> >
> > Signed-off-by: Christian König <christian.koenig@amd.com>
>
> Looks reasonable to me,
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>

Christian, are you going to go ahead and push this one?

>
> > ---
> >  drivers/gpu/drm/ttm/ttm_bo_util.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> > index 57a27847206f..911141d16e95 100644
> > --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> > +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> > @@ -236,6 +236,11 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
> >         if (bo->type != ttm_bo_type_sg)
> >                 fbo->base.base.resv = &fbo->base.base._resv;
> >
> > +       dma_resv_init(&fbo->base.base._resv);
> > +       fbo->base.base.dev = NULL;
> > +       ret = dma_resv_trylock(&fbo->base.base._resv);
> > +       WARN_ON(!ret);
> > +
> >         if (fbo->base.resource) {
> >                 ttm_resource_set_bo(fbo->base.resource, &fbo->base);
> >                 bo->resource = NULL;
> > @@ -244,11 +249,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
> >                 fbo->base.bulk_move = NULL;
> >         }
> >
> > -       dma_resv_init(&fbo->base.base._resv);
> > -       fbo->base.base.dev = NULL;
> > -       ret = dma_resv_trylock(&fbo->base.base._resv);
> > -       WARN_ON(!ret);
> > -
> >         ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1);
> >         if (ret) {
> >                 kfree(fbo);
> > --
> > 2.25.1
> >

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

* Re: [PATCH] drm/ttm: cleanup the resource of ghost objects after locking them
  2022-09-08  7:46   ` Matthew Auld
@ 2022-09-08  7:51     ` Christian König
  0 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2022-09-08  7:51 UTC (permalink / raw)
  To: Matthew Auld
  Cc: ZhenGuo Yin, jingwen.chen2, Christian König, ML dri-devel

Am 08.09.22 um 09:46 schrieb Matthew Auld:
> On Wed, 7 Sept 2022 at 11:26, Matthew Auld
> <matthew.william.auld@gmail.com> wrote:
>> On Wed, 7 Sept 2022 at 11:00, Christian König
>> <ckoenig.leichtzumerken@gmail.com> wrote:
>>> Otherwise lockdep will complain about cleaning up the bulk_move.
>>>
>>> Not even compile tested.
>>>
>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> Looks reasonable to me,
>> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> Christian, are you going to go ahead and push this one?

Pushed. Thanks for the reminder, just forgot to do that yesterday.

Christian.

>
>>> ---
>>>   drivers/gpu/drm/ttm/ttm_bo_util.c | 10 +++++-----
>>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
>>> index 57a27847206f..911141d16e95 100644
>>> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
>>> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
>>> @@ -236,6 +236,11 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
>>>          if (bo->type != ttm_bo_type_sg)
>>>                  fbo->base.base.resv = &fbo->base.base._resv;
>>>
>>> +       dma_resv_init(&fbo->base.base._resv);
>>> +       fbo->base.base.dev = NULL;
>>> +       ret = dma_resv_trylock(&fbo->base.base._resv);
>>> +       WARN_ON(!ret);
>>> +
>>>          if (fbo->base.resource) {
>>>                  ttm_resource_set_bo(fbo->base.resource, &fbo->base);
>>>                  bo->resource = NULL;
>>> @@ -244,11 +249,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
>>>                  fbo->base.bulk_move = NULL;
>>>          }
>>>
>>> -       dma_resv_init(&fbo->base.base._resv);
>>> -       fbo->base.base.dev = NULL;
>>> -       ret = dma_resv_trylock(&fbo->base.base._resv);
>>> -       WARN_ON(!ret);
>>> -
>>>          ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1);
>>>          if (ret) {
>>>                  kfree(fbo);
>>> --
>>> 2.25.1
>>>


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

end of thread, other threads:[~2022-09-08  7:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 10:00 [PATCH] drm/ttm: cleanup the resource of ghost objects after locking them Christian König
2022-09-07 10:10 ` Matthew Auld
2022-09-07 10:26 ` Matthew Auld
2022-09-08  7:46   ` Matthew Auld
2022-09-08  7:51     ` Christian König

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