From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Eric Huang <jinhuieric.huang@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 1/2] drm/amdgpu: Fix a bug on flag table_freed
Date: Tue, 1 Jun 2021 09:02:02 +0200 [thread overview]
Message-ID: <d80dce26-ddf9-ecee-501f-e3afc0595f4d@gmail.com> (raw)
In-Reply-To: <20210601000625.551445-1-jinhuieric.huang@amd.com>
Am 01.06.21 um 02:06 schrieb Eric Huang:
> table_freed will be always true when mapping a memory with size
> bigger than 2MB. The problem is page table's entries are always
> existed, but existing mapping depends on page talbe's bo, so
> using a check of page table's bo existed will resolve the issue.
>
> Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com> for this one.
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 539c117906cc..2c20bba7dc1a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1582,9 +1582,12 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
> * completely covered by the range and so potentially still in use.
> */
> while (cursor.pfn < frag_start) {
> - amdgpu_vm_free_pts(adev, params->vm, &cursor);
> + /* Make sure previous mapping is freed */
> + if (cursor.entry->base.bo) {
> + params->table_freed = true;
> + amdgpu_vm_free_pts(adev, params->vm, &cursor);
> + }
> amdgpu_vm_pt_next(adev, &cursor);
> - params->table_freed = true;
> }
>
> } else if (frag >= shift) {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
prev parent reply other threads:[~2021-06-01 7:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 0:06 [PATCH v2 1/2] drm/amdgpu: Fix a bug on flag table_freed Eric Huang
2021-06-01 0:06 ` [PATCH v2 2/2] drm/amdgpu: Don't flush HDP on A+A Eric Huang
2021-06-01 7:05 ` Christian König
2021-06-01 14:45 ` Eric Huang
2021-06-01 17:38 ` Christian König
2021-06-01 7:02 ` Christian König [this message]
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=d80dce26-ddf9-ecee-501f-e3afc0595f4d@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=jinhuieric.huang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.