2023-08-07 18:01:14

by Danilo Krummrich

[permalink] [raw]
Subject: [PATCH drm-misc-next 0/5] Nouveau VM_BIND uAPI Fixes

The patch series provides a few fixes for the recently merged VM_BIND uAPI
mostly addressing a couple of warnings.

It also contains one patch to slightly reduce the memory footprint of
struct nouveau_uvma.

Danilo Krummrich (5):
nouveau/dmem: fix copy-paste error in nouveau_dmem_migrate_chunk()
drm/nouveau: nvkm: vmm: silence warning from cast
drm/nouveau: remove incorrect __user annotations
drm/nouveau: uvmm: remove incorrect calls to mas_unlock()
drm/nouveau: uvmm: remove dedicated VM pointer from VMAs

drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_exec.c | 6 ++---
drivers/gpu/drm/nouveau/nouveau_exec.h | 2 +-
drivers/gpu/drm/nouveau/nouveau_uvmm.c | 23 ++++++++-----------
drivers/gpu/drm/nouveau/nouveau_uvmm.h | 14 +++++------
.../gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c | 5 ++--
6 files changed, 24 insertions(+), 28 deletions(-)


base-commit: 82d750e9d2f5d0594c8f7057ce59127e701af781
--
2.41.0



2023-08-07 19:36:49

by Danilo Krummrich

[permalink] [raw]
Subject: [PATCH drm-misc-next 4/5] drm/nouveau: uvmm: remove incorrect calls to mas_unlock()

Remove incorrect calls to mas_unlock() in the unwind path of
__nouveau_uvma_region_insert(). The region maple tree uses an external
lock instead, namely the global uvmm lock.

Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Danilo Krummrich <[email protected]>
---
drivers/gpu/drm/nouveau/nouveau_uvmm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
index 2acbac73e57a..91b964ef98b1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
@@ -279,15 +279,11 @@ __nouveau_uvma_region_insert(struct nouveau_uvmm *uvmm,
u64 last = addr + range - 1;
MA_STATE(mas, &uvmm->region_mt, addr, addr);

- if (unlikely(mas_walk(&mas))) {
- mas_unlock(&mas);
+ if (unlikely(mas_walk(&mas)))
return -EEXIST;
- }

- if (unlikely(mas.last < last)) {
- mas_unlock(&mas);
+ if (unlikely(mas.last < last))
return -EEXIST;
- }

mas.index = addr;
mas.last = last;
--
2.41.0


2023-08-08 15:50:12

by Dave Airlie

[permalink] [raw]
Subject: Re: [PATCH drm-misc-next 0/5] Nouveau VM_BIND uAPI Fixes

For the series:

Reviewed-by: Dave Airlie <[email protected]>

On Tue, 8 Aug 2023 at 02:32, Danilo Krummrich <[email protected]> wrote:
>
> The patch series provides a few fixes for the recently merged VM_BIND uAPI
> mostly addressing a couple of warnings.
>
> It also contains one patch to slightly reduce the memory footprint of
> struct nouveau_uvma.
>
> Danilo Krummrich (5):
> nouveau/dmem: fix copy-paste error in nouveau_dmem_migrate_chunk()
> drm/nouveau: nvkm: vmm: silence warning from cast
> drm/nouveau: remove incorrect __user annotations
> drm/nouveau: uvmm: remove incorrect calls to mas_unlock()
> drm/nouveau: uvmm: remove dedicated VM pointer from VMAs
>
> drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_exec.c | 6 ++---
> drivers/gpu/drm/nouveau/nouveau_exec.h | 2 +-
> drivers/gpu/drm/nouveau/nouveau_uvmm.c | 23 ++++++++-----------
> drivers/gpu/drm/nouveau/nouveau_uvmm.h | 14 +++++------
> .../gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c | 5 ++--
> 6 files changed, 24 insertions(+), 28 deletions(-)
>
>
> base-commit: 82d750e9d2f5d0594c8f7057ce59127e701af781
> --
> 2.41.0
>