]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nouveau/svm: fix missing folio unlock + put after make_device_exclusive_range()
authorDavid Hildenbrand <david@redhat.com>
Fri, 24 Jan 2025 18:15:23 +0000 (19:15 +0100)
committerDanilo Krummrich <dakr@kernel.org>
Fri, 14 Feb 2025 14:52:58 +0000 (15:52 +0100)
commitb3fefbb30a1691533cb905006b69b2a474660744
tree62b891bc81a786a08ff8f4f1a8c7cbcce7f945f5
parenta8972d5a49b408248294b5ecbdd0a085e4726349
nouveau/svm: fix missing folio unlock + put after make_device_exclusive_range()

In case we have to retry the loop, we are missing to unlock+put the
folio. In that case, we will keep failing make_device_exclusive_range()
because we cannot grab the folio lock, and even return from the function
with the folio locked and referenced, effectively never succeeding the
make_device_exclusive_range().

While at it, convert the other unlock+put to use a folio as well.

This was found by code inspection.

Fixes: 8f187163eb89 ("nouveau/svm: implement atomic SVM access")
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Tested-by: Alistair Popple <apopple@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250124181524.3584236-2-david@redhat.com
drivers/gpu/drm/nouveau/nouveau_svm.c