]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2025 15:56:37 +0000 (16:56 +0100)
commit7f7f3f42e8b6cee497d18d6a974cbed84975ee77
tree5ce813029ee3d328b1e38f209825ebc8221f21ce
parent51ae6861c41178f224550179cd43503843facef9
nouveau/svm: fix missing folio unlock + put after make_device_exclusive_range()

[ Upstream commit b3fefbb30a1691533cb905006b69b2a474660744 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/nouveau/nouveau_svm.c