summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Glisse <jglisse@redhat.com>2018-08-24 12:34:19 -0400
committerJérôme Glisse <jglisse@redhat.com>2018-08-24 12:34:19 -0400
commita4a83f87d595f570aeda3eb4f40e5f3b893ac77d (patch)
tree2603ba6559dbae2d11126ef807ccd08f2c1eb540
parentaa216b47b309fe530ca691f6bc5fea4b323bbc96 (diff)
gpu/nouveau: fix svm in respect to upstream changehmm-nouveau-v01
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_svm.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c
index 345e4935575a..23435ee27892 100644
--- a/drivers/gpu/drm/nouveau/nouveau_svm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_svm.c
@@ -162,27 +162,33 @@ nouveau_svmm_invalidate(struct nouveau_svmm *svmm, u64 start, u64 limit)
}
}
-static void
+static int
nouveau_svmm_sync_cpu_device_pagetables(struct hmm_mirror *mirror,
- enum hmm_update_type update,
- unsigned long start,
- unsigned long limit)
+ const struct hmm_update *update)
{
struct nouveau_svmm *svmm = container_of(mirror, typeof(*svmm), mirror);
+ unsigned long start = update->start, end = update->end;
+
+ SVMM_DBG(svmm, "invalidate %016lx-%016lx", start, end);
- SVMM_DBG(svmm, "invalidate %016lx-%016lx", start, limit);
+ /* For now always bail out when we can not block. */
+ if (!update->blockable)
+ return -EAGAIN;
mutex_lock(&svmm->mutex);
- if (limit > svmm->unmanaged.start && start < svmm->unmanaged.limit) {
+ /* Ignore anything inside the unmanaged area. */
+ if (end > svmm->unmanaged.start && start < svmm->unmanaged.limit) {
if (start < svmm->unmanaged.start) {
nouveau_svmm_invalidate(svmm, start,
svmm->unmanaged.limit);
}
start = svmm->unmanaged.limit;
}
-
- nouveau_svmm_invalidate(svmm, start, limit);
+ if (start < end)
+ nouveau_svmm_invalidate(svmm, start, end);
mutex_unlock(&svmm->mutex);
+
+ return 0;
}
static void