Commit 5fbcf501 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jason Gunthorpe

nouveau: remove the block parameter to nouveau_range_fault

The parameter is always false, so remove it as well as the -EAGAIN
handling that can only happen for the non-blocking case.

Link: https://lore.kernel.org/r/20190724065258.16603-4-hch@lst.deTested-by: default avatarRalph Campbell <rcampbell@nvidia.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 02712bc3
...@@ -485,8 +485,7 @@ nouveau_range_done(struct hmm_range *range) ...@@ -485,8 +485,7 @@ nouveau_range_done(struct hmm_range *range)
} }
static int static int
nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range, nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range)
bool block)
{ {
long ret; long ret;
...@@ -504,13 +503,12 @@ nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range, ...@@ -504,13 +503,12 @@ nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range,
return -EAGAIN; return -EAGAIN;
} }
ret = hmm_range_fault(range, block); ret = hmm_range_fault(range, true);
if (ret <= 0) { if (ret <= 0) {
if (ret == -EBUSY || !ret) { if (ret == -EBUSY || !ret) {
up_read(&range->vma->vm_mm->mmap_sem); up_read(&range->vma->vm_mm->mmap_sem);
ret = -EBUSY; ret = -EBUSY;
} else if (ret == -EAGAIN) }
ret = -EBUSY;
hmm_range_unregister(range); hmm_range_unregister(range);
return ret; return ret;
} }
...@@ -691,7 +689,7 @@ nouveau_svm_fault(struct nvif_notify *notify) ...@@ -691,7 +689,7 @@ nouveau_svm_fault(struct nvif_notify *notify)
range.values = nouveau_svm_pfn_values; range.values = nouveau_svm_pfn_values;
range.pfn_shift = NVIF_VMM_PFNMAP_V0_ADDR_SHIFT; range.pfn_shift = NVIF_VMM_PFNMAP_V0_ADDR_SHIFT;
again: again:
ret = nouveau_range_fault(&svmm->mirror, &range, true); ret = nouveau_range_fault(&svmm->mirror, &range);
if (ret == 0) { if (ret == 0) {
mutex_lock(&svmm->mutex); mutex_lock(&svmm->mutex);
if (!nouveau_range_done(&range)) { if (!nouveau_range_done(&range)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment