From: Lang Yu <Lang.Yu@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Jack Xiao <Jack.Xiao@amd.com>, Lang Yu <Lang.Yu@amd.com>,
Christian Koenig <christian.koenig@amd.com>
Subject: [PATCH] drm/amdgpu: avoid null dereference of fence when using cpu to update page tables
Date: Fri, 5 May 2023 17:10:20 +0800 [thread overview]
Message-ID: <20230505091020.1383923-1-Lang.Yu@amd.com> (raw)
Using cpu to update page tables is sychronous, no need to wait fence
and it is NULL in such a case.
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
index f0f00466b59f..197981c4ac7d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
@@ -1043,8 +1043,11 @@ int amdgpu_mes_add_ring(struct amdgpu_device *adev, int gang_id,
amdgpu_mes_ring_to_queue_props(adev, ring, &qprops);
- dma_fence_wait(gang->process->vm->last_update, false);
- dma_fence_wait(ctx_data->meta_data_va->last_pt_update, false);
+ if (gang->process->vm->last_update)
+ dma_fence_wait(gang->process->vm->last_update, false);
+ if (ctx_data->meta_data_va->last_pt_update)
+ dma_fence_wait(ctx_data->meta_data_va->last_pt_update, false);
+
amdgpu_mes_unlock(&adev->mes);
r = amdgpu_mes_add_hw_queue(adev, gang_id, &qprops, &queue_id);
--
2.25.1
next reply other threads:[~2023-05-05 9:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-05 9:10 Lang Yu [this message]
2023-05-05 11:13 ` [PATCH] drm/amdgpu: avoid null dereference of fence when using cpu to update page tables Christian König
2023-05-05 12:42 ` Lang Yu
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=20230505091020.1383923-1-Lang.Yu@amd.com \
--to=lang.yu@amd.com \
--cc=Jack.Xiao@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@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