From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Subject: [PATCH 2/2] nouveau/umem: rename nvkm client lock to umem_lock
Date: Fri, 1 Mar 2024 13:42:38 +1000 [thread overview]
Message-ID: <20240301034238.3041715-2-airlied@gmail.com> (raw)
In-Reply-To: <20240301034238.3041715-1-airlied@gmail.com>
From: Dave Airlie <airlied@redhat.com>
This lock is just protecting the umem list so name it as such.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/nouveau/include/nvkm/core/client.h | 2 +-
drivers/gpu/drm/nouveau/nvkm/core/client.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c | 12 ++++++------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/client.h b/drivers/gpu/drm/nouveau/include/nvkm/core/client.h
index 932c9fd0b2d8..6ca50e864e86 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/client.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/client.h
@@ -17,7 +17,7 @@ struct nvkm_client {
int (*event)(u64 token, void *argv, u32 argc);
struct list_head umem;
- spinlock_t lock;
+ spinlock_t umem_lock;
};
int nvkm_client_new(const char *name, u64 device, const char *cfg, const char *dbg,
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/client.c b/drivers/gpu/drm/nouveau/nvkm/core/client.c
index c55662937ab2..2885795f71d4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/client.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/client.c
@@ -183,6 +183,6 @@ nvkm_client_new(const char *name, u64 device, const char *cfg, const char *dbg,
spin_lock_init(&client->obj_lock);
client->event = event;
INIT_LIST_HEAD(&client->umem);
- spin_lock_init(&client->lock);
+ spin_lock_init(&client->umem_lock);
return 0;
}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c
index e530bb8b3b17..a16cc20b835f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/umem.c
@@ -42,14 +42,14 @@ nvkm_umem_search(struct nvkm_client *client, u64 handle)
object = nvkm_object_search(client, handle, &nvkm_umem);
if (IS_ERR(object)) {
if (client != master) {
- spin_lock(&master->lock);
+ spin_lock(&master->umem_lock);
list_for_each_entry(umem, &master->umem, head) {
if (umem->object.object == handle) {
memory = nvkm_memory_ref(umem->memory);
break;
}
}
- spin_unlock(&master->lock);
+ spin_unlock(&master->umem_lock);
}
} else {
umem = nvkm_umem(object);
@@ -124,9 +124,9 @@ static void *
nvkm_umem_dtor(struct nvkm_object *object)
{
struct nvkm_umem *umem = nvkm_umem(object);
- spin_lock(&umem->object.client->lock);
+ spin_lock(&umem->object.client->umem_lock);
list_del_init(&umem->head);
- spin_unlock(&umem->object.client->lock);
+ spin_unlock(&umem->object.client->umem_lock);
nvkm_memory_unref(&umem->memory);
return umem;
}
@@ -179,9 +179,9 @@ nvkm_umem_new(const struct nvkm_oclass *oclass, void *argv, u32 argc,
if (ret)
return ret;
- spin_lock(&umem->object.client->lock);
+ spin_lock(&umem->object.client->umem_lock);
list_add(&umem->head, &umem->object.client->umem);
- spin_unlock(&umem->object.client->lock);
+ spin_unlock(&umem->object.client->umem_lock);
args->v0.page = nvkm_memory_page(umem->memory);
args->v0.addr = nvkm_memory_addr(umem->memory);
--
2.43.2
next prev parent reply other threads:[~2024-03-01 3:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 3:42 [PATCH 1/2] nouveau: lock the client object tree Dave Airlie
2024-03-01 3:42 ` Dave Airlie [this message]
2024-03-04 15:49 ` Danilo Krummrich
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=20240301034238.3041715-2-airlied@gmail.com \
--to=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=nouveau@lists.freedesktop.org \
/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.