diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-10-30 02:25:34 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-10-30 02:25:34 +0000 |
commit | 1771e370644e6ae67e5050fbfa47526338f76310 (patch) | |
tree | af151c47f2cb7ae41b49f643af8b4b72d0ba39e6 /sys/dev/pci/drm | |
parent | 685f262f0d5c5a2424cafdad0654665f65dbcfde (diff) |
drm/ttm: Restore ttm prefaulting
From Thomas Hellstrom
11377c3e997eca9c9ff562fc4fc7a41a455bddf6 in linux 4.19.y/4.19.81
941f2f72dbbe0cf8c2d6e0b180a8021a0ec477fa in mainline linux
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/ttm/ttm_bo_vm.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/dev/pci/drm/ttm/ttm_bo_vm.c b/sys/dev/pci/drm/ttm/ttm_bo_vm.c index cf275e8b524..487241c7dda 100644 --- a/sys/dev/pci/drm/ttm/ttm_bo_vm.c +++ b/sys/dev/pci/drm/ttm/ttm_bo_vm.c @@ -275,15 +275,13 @@ static vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf) else ret = vmf_insert_pfn(&cvma, address, pfn); - /* - * Somebody beat us to this PTE or prefaulting to - * an already populated PTE, or prefaulting error. - */ - - if (unlikely((ret == VM_FAULT_NOPAGE && i > 0))) - break; - else if (unlikely(ret & VM_FAULT_ERROR)) - goto out_io_unlock; + /* Never error on prefaulted PTEs */ + if (unlikely((ret & VM_FAULT_ERROR))) { + if (i == 0) + goto out_io_unlock; + else + break; + } address += PAGE_SIZE; if (unlikely(++page_offset >= page_last)) |