AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Nirmoy Das <nirmoy.das@amd.com>, amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, Christian.Koenig@amd.com
Subject: Re: [PATCH 1/1] drm/amdgpu: clean up bo in vce and vcn test
Date: Tue, 8 Dec 2020 18:39:30 +0100	[thread overview]
Message-ID: <772be2aa-56f0-14d5-3de4-343c556e1dc2@gmail.com> (raw)
In-Reply-To: <20201208155508.6036-1-nirmoy.das@amd.com>

Am 08.12.20 um 16:55 schrieb Nirmoy Das:
> BO created with amdgpu_bo_create_reserved wasn't clean
> properly before which causes:

I would rather like to keep the code as it is and just replace the 
amdgpu_bo_unref() with amdgpu_bo_free_kernel().

But apart from that I think we can stick with this.

Christian.

>
> [   21.056218] WARNING: CPU: 0 PID: 7 at drivers/gpu/drm/ttm/ttm_bo.c:518 ttm_bo_release+0x2bf/0x310 [ttm]
> <snip>
> [   21.056430] Call Trace:
> [   21.056525]  amdgpu_bo_unref+0x1a/0x30 [amdgpu]
> [   21.056635]  amdgpu_vcn_dec_send_msg+0x1b2/0x270 [amdgpu]
> [   21.056740]  amdgpu_vcn_dec_get_create_msg.constprop.0+0xd8/0x100 [amdgpu]
> [   21.056843]  amdgpu_vcn_dec_ring_test_ib+0x27/0x180 [amdgpu]
> [   21.056936]  amdgpu_ib_ring_tests+0xf1/0x150 [amdgpu]
> [   21.057024]  amdgpu_device_delayed_init_work_handler+0x11/0x30 [amdgpu]
> [   21.057030]  process_one_work+0x1df/0x370
> [   21.057033]  worker_thread+0x46/0x340
> [   21.057034]  ? process_one_work+0x370/0x370
> [   21.057037]  kthread+0x11b/0x140
> [   21.057039]  ? __kthread_bind_mask+0x60/0x60
> [   21.057043]  ret_from_fork+0x22/0x30
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c |  2 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 16 ++++++++++------
>   2 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> index ecaa2d7483b2..78a4dd9bf11f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> @@ -1151,6 +1151,6 @@ int amdgpu_vce_ring_test_ib(struct amdgpu_ring *ring, long timeout)
>   error:
>   	dma_fence_put(fence);
>   	amdgpu_bo_unreserve(bo);
> -	amdgpu_bo_unref(&bo);
> +	amdgpu_bo_free_kernel(&bo, NULL, NULL);
>   	return r;
>   }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 7e19a6656715..dfcdd38ff9c2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> @@ -491,8 +491,6 @@ static int amdgpu_vcn_dec_send_msg(struct amdgpu_ring *ring,
>   		goto err_free;
>   
>   	amdgpu_bo_fence(bo, f, false);
> -	amdgpu_bo_unreserve(bo);
> -	amdgpu_bo_unref(&bo);
>   
>   	if (fence)
>   		*fence = dma_fence_get(f);
> @@ -504,8 +502,6 @@ static int amdgpu_vcn_dec_send_msg(struct amdgpu_ring *ring,
>   	amdgpu_job_free(job);
>   
>   err:
> -	amdgpu_bo_unreserve(bo);
> -	amdgpu_bo_unref(&bo);
>   	return r;
>   }
>   
> @@ -540,7 +536,11 @@ static int amdgpu_vcn_dec_get_create_msg(struct amdgpu_ring *ring, uint32_t hand
>   	for (i = 14; i < 1024; ++i)
>   		msg[i] = cpu_to_le32(0x0);
>   
> -	return amdgpu_vcn_dec_send_msg(ring, bo, fence);
> +	r = amdgpu_vcn_dec_send_msg(ring, bo, fence);
> +	amdgpu_bo_unreserve(bo);
> +	amdgpu_bo_free_kernel(&bo, NULL, (void **)&msg);
> +
> +	return r;
>   }
>   
>   static int amdgpu_vcn_dec_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
> @@ -566,7 +566,11 @@ static int amdgpu_vcn_dec_get_destroy_msg(struct amdgpu_ring *ring, uint32_t han
>   	for (i = 6; i < 1024; ++i)
>   		msg[i] = cpu_to_le32(0x0);
>   
> -	return amdgpu_vcn_dec_send_msg(ring, bo, fence);
> +	r = amdgpu_vcn_dec_send_msg(ring, bo, fence);
> +	amdgpu_bo_unreserve(bo);
> +	amdgpu_bo_free_kernel(&bo, NULL, (void **)&msg);
> +
> +	return r;
>   }
>   
>   int amdgpu_vcn_dec_ring_test_ib(struct amdgpu_ring *ring, long timeout)

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2020-12-08 17:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 15:55 [PATCH 1/1] drm/amdgpu: clean up bo in vce and vcn test Nirmoy Das
2020-12-08 17:39 ` Christian König [this message]
2020-12-08 18:59   ` [PATCH v2 " Nirmoy Das
2020-12-08 19:04     ` Christian König
2020-12-08 19:39       ` Nirmoy
2020-12-17 14:25         ` Christian König
2020-12-18 10:57           ` Nirmoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=772be2aa-56f0-14d5-3de4-343c556e1dc2@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Christian.Koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=nirmoy.das@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox