}
static int
-nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range)
+nouveau_range_fault(struct nouveau_svmm *svmm, struct hmm_range *range)
{
long ret;
range->default_flags = 0;
range->pfn_flags_mask = -1UL;
- ret = hmm_range_register(range, mirror,
+ ret = hmm_range_register(range, &svmm->mirror,
range->start, range->end,
PAGE_SHIFT);
if (ret) {
- up_read(&range->hmm->mm->mmap_sem);
+ up_read(&svmm->mm->mmap_sem);
return (int)ret;
}
if (!hmm_range_wait_until_valid(range, HMM_RANGE_DEFAULT_TIMEOUT)) {
- up_read(&range->hmm->mm->mmap_sem);
+ up_read(&svmm->mm->mmap_sem);
return -EBUSY;
}
if (ret <= 0) {
if (ret == 0)
ret = -EBUSY;
- up_read(&range->hmm->mm->mmap_sem);
+ up_read(&svmm->mm->mmap_sem);
hmm_range_unregister(range);
return ret;
}
range.values = nouveau_svm_pfn_values;
range.pfn_shift = NVIF_VMM_PFNMAP_V0_ADDR_SHIFT;
again:
- ret = nouveau_range_fault(&svmm->mirror, &range);
+ ret = nouveau_range_fault(svmm, &range);
if (ret == 0) {
mutex_lock(&svmm->mutex);
if (!nouveau_range_done(&range)) {