search for: nouveau_sgdma_destroy

Displaying 7 results from an estimated 7 matches for "nouveau_sgdma_destroy".

2014 Dec 10
1
[PATCH] drm: sgdma: free allocated memory if TT init fails
...Mirkin wrote: > We get this patch every few months... How about one that instead adds > a comment which explains why this kfree isn't needed :) [I'm leaving > the reason to the reader, which will force you to glance at the ttm > code.] ttm_dma_tt_init -> ttm_tt_destroy -> nouveau_sgdma_destroy -> kfree Urrk. I'm definitely not a fan of things happening this way, but let it be. Indeed a comment would be nice to have here, let me prep a patch for this instead...
2015 Dec 11
1
[PATCH] ttm/drm: constify ttm_backend_func structures
...rs/gpu/drm/nouveau/nouveau_sgdma.c @@ -51,7 +51,7 @@ nv04_sgdma_unbind(struct ttm_tt *ttm) return 0; } -static struct ttm_backend_func nv04_sgdma_backend = { +static const struct ttm_backend_func nv04_sgdma_backend = { .bind = nv04_sgdma_bind, .unbind = nv04_sgdma_unbind, .destroy = nouveau_sgdma_destroy @@ -82,7 +82,7 @@ nv50_sgdma_unbind(struct ttm_tt *ttm) return 0; } -static struct ttm_backend_func nv50_sgdma_backend = { +static const struct ttm_backend_func nv50_sgdma_backend = { .bind = nv50_sgdma_bind, .unbind = nv50_sgdma_unbind, .destroy = nouveau_sgdma_destroy diff --git a...
2015 Dec 11
1
[PATCH] ttm/drm: constify ttm_backend_func structures
...rs/gpu/drm/nouveau/nouveau_sgdma.c @@ -51,7 +51,7 @@ nv04_sgdma_unbind(struct ttm_tt *ttm) return 0; } -static struct ttm_backend_func nv04_sgdma_backend = { +static const struct ttm_backend_func nv04_sgdma_backend = { .bind = nv04_sgdma_bind, .unbind = nv04_sgdma_unbind, .destroy = nouveau_sgdma_destroy @@ -82,7 +82,7 @@ nv50_sgdma_unbind(struct ttm_tt *ttm) return 0; } -static struct ttm_backend_func nv50_sgdma_backend = { +static const struct ttm_backend_func nv50_sgdma_backend = { .bind = nv50_sgdma_bind, .unbind = nv50_sgdma_unbind, .destroy = nouveau_sgdma_destroy diff --git a...
2014 Dec 10
2
[PATCH] drm: sgdma: free allocated memory if TT init fails
When ttm_dma_tt_init() fails in nouveau_sgdma_create_ttm(), we should free the previously allocated memory before returning NULL. Signed-off-by: Alexandre Courbot <acourbot at nvidia.com> --- drm/nouveau_sgdma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drm/nouveau_sgdma.c b/drm/nouveau_sgdma.c index 01707e7deaf5..e4fc494d688d 100644 --- a/drm/nouveau_sgdma.c
2014 Dec 10
0
[PATCH] drm: sgdma: add comment around suspiscious error handler
....c @@ -106,6 +106,11 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev, nvbe->ttm.ttm.func = &nv50_sgdma_backend; if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page)) + /* + * A failing ttm_dma_tt_init() will call ttm_tt_destroy() + * and thus our nouveau_sgdma_destroy() hook, so we don't need + * to free nvbe here. + */ return NULL; return &nvbe->ttm.ttm; } -- 2.1.3
2020 Oct 23
0
kvm+nouveau induced lockdep gripe
...syscall_exit_to_user_mode+0x46/0x2a0 [ 70.136195] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 70.136200] -> #1 (&cli->lock){+.+.}-{3:3}: [ 70.136209] __mutex_lock+0x90/0x9c0 [ 70.136252] nouveau_mem_fini+0x4c/0x70 [nouveau] [ 70.136294] nouveau_sgdma_destroy+0x20/0x50 [nouveau] [ 70.136302] ttm_bo_cleanup_memtype_use+0x3e/0x60 [ttm] [ 70.136310] ttm_bo_release+0x29c/0x600 [ttm] [ 70.136317] ttm_bo_vm_close+0x15/0x30 [ttm] [ 70.136324] remove_vma+0x3e/0x70 [ 70.136329] __do_munmap+0x2b7/0x4f0 [ 70.136333]...
2020 Oct 24
1
kvm+nouveau induced lockdep gripe
...6/0x2a0 > [ 70.136195] entry_SYSCALL_64_after_hwframe+0x44/0xa9 > [ 70.136200] > -> #1 (&cli->lock){+.+.}-{3:3}: > [ 70.136209] __mutex_lock+0x90/0x9c0 > [ 70.136252] nouveau_mem_fini+0x4c/0x70 [nouveau] > [ 70.136294] nouveau_sgdma_destroy+0x20/0x50 [nouveau] > [ 70.136302] ttm_bo_cleanup_memtype_use+0x3e/0x60 [ttm] > [ 70.136310] ttm_bo_release+0x29c/0x600 [ttm] Looks like we can break the lock chain by moving ttm bo's release method out of mmap_lock, see diff below. > [ 70.136317] ttm_bo_vm...