All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Yang <Philip.Yang@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Philip Yang <Philip.Yang@amd.com>,
	felix.kuehling@amd.com, christian.koenig@amd.com
Subject: [PATCH v2 3/7] drm/amdgpu: Use vm status_lock to protect vm idle list
Date: Mon, 19 Sep 2022 13:15:49 -0400	[thread overview]
Message-ID: <20220919171553.11286-4-Philip.Yang@amd.com> (raw)
In-Reply-To: <20220919171553.11286-1-Philip.Yang@amd.com>

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 4a1cb20deb2d..c3412709e626 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -211,7 +211,9 @@ static void amdgpu_vm_bo_moved(struct amdgpu_vm_bo_base *vm_bo)
  */
 static void amdgpu_vm_bo_idle(struct amdgpu_vm_bo_base *vm_bo)
 {
+	spin_lock(&vm_bo->vm->status_lock);
 	list_move(&vm_bo->vm_status, &vm_bo->vm->idle);
+	spin_unlock(&vm_bo->vm->status_lock);
 	vm_bo->moved = false;
 }
 
@@ -2554,6 +2556,7 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m)
 	unsigned int total_done_objs = 0;
 	unsigned int id = 0;
 
+	spin_lock(&vm->status_lock);
 	seq_puts(m, "\tIdle BOs:\n");
 	list_for_each_entry_safe(bo_va, tmp, &vm->idle, base.vm_status) {
 		if (!bo_va->base.bo)
@@ -2591,7 +2594,6 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m)
 	id = 0;
 
 	seq_puts(m, "\tInvalidated BOs:\n");
-	spin_lock(&vm->status_lock);
 	list_for_each_entry_safe(bo_va, tmp, &vm->invalidated, base.vm_status) {
 		if (!bo_va->base.bo)
 			continue;
-- 
2.35.1


  parent reply	other threads:[~2022-09-19 17:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 17:15 [PATCH v2 0/7] Fix amdgpu_vm_pt_free warning Philip Yang
2022-09-19 17:15 ` [PATCH v2 1/7] drm/amdgpu: Rename vm invalidate lock to status_lock Philip Yang
2022-09-20 15:21   ` Felix Kuehling
2022-09-19 17:15 ` [PATCH v2 2/7] drm/amdgpu: Use vm status_lock to protect relocated list Philip Yang
2022-09-19 17:15 ` Philip Yang [this message]
2022-09-19 17:15 ` [PATCH v2 4/7] drm/amdgpu: Use vm status_lock to protect vm moved list Philip Yang
2022-09-19 17:15 ` [PATCH v2 5/7] drm/amdgpu: Use vm status_lock to protect vm evicted list Philip Yang
2022-09-19 17:15 ` [PATCH v2 6/7] drm/amdgpu: Use vm status_lock to protect pt free Philip Yang
2022-09-19 17:15 ` [PATCH v2 7/7] drm/amdgpu: Fix amdgpu_vm_pt_free warning Philip Yang
2022-09-20 15:17   ` Felix Kuehling
2022-09-20 15:43   ` Christian König

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=20220919171553.11286-4-Philip.Yang@amd.com \
    --to=philip.yang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=felix.kuehling@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.