diff options
author | 2018-08-20 06:56:58 +0000 | |
---|---|---|
committer | 2018-08-20 06:56:58 +0000 | |
commit | ec24752a8be8a865e884315b3e0098cde286d4f6 (patch) | |
tree | 8f79f7a6d6f211f8cb7d247b813706006de71c61 | |
parent | Since we can feed localtime(3) with garbage input, or with input it cannot (diff) | |
download | wireguard-openbsd-ec24752a8be8a865e884315b3e0098cde286d4f6.tar.xz wireguard-openbsd-ec24752a8be8a865e884315b3e0098cde286d4f6.zip |
Cached tests moved from callers into ttm_io_prot() with linux 3.18
which was partly missed when the 4.4 ttm changes went in.
Prompted by a patch from kettenis@
-rw-r--r-- | sys/dev/pci/drm/ttm/ttm_bo_util.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/drm/ttm/ttm_bo_vm.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/ttm/ttm_bo_util.c b/sys/dev/pci/drm/ttm/ttm_bo_util.c index da6c459bd39..13f408af6df 100644 --- a/sys/dev/pci/drm/ttm/ttm_bo_util.c +++ b/sys/dev/pci/drm/ttm/ttm_bo_util.c @@ -514,6 +514,9 @@ EXPORT_SYMBOL(ttm_io_prot); pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp) { + /* Cached mappings need no adjustment */ + if (caching_flags & TTM_PL_FLAG_CACHED) + return tmp; #ifdef PMAP_WC if (caching_flags & TTM_PL_FLAG_WC) return PMAP_WC; diff --git a/sys/dev/pci/drm/ttm/ttm_bo_vm.c b/sys/dev/pci/drm/ttm/ttm_bo_vm.c index de7cee96a22..04d25f4bcca 100644 --- a/sys/dev/pci/drm/ttm/ttm_bo_vm.c +++ b/sys/dev/pci/drm/ttm/ttm_bo_vm.c @@ -372,8 +372,7 @@ ttm_bo_vm_fault(struct uvm_faultinfo *ufi, vaddr_t vaddr, vm_page_t *pps, pmap_flags = ttm_io_prot(bo->mem.placement, 0); } else { ttm = bo->ttm; - pmap_flags = (bo->mem.placement & TTM_PL_FLAG_CACHED) ? - 0 : ttm_io_prot(bo->mem.placement, 0); + pmap_flags = ttm_io_prot(bo->mem.placement, 0); /* Allocate all page at once, most common usage */ if (ttm->bdev->driver->ttm_tt_populate(ttm)) { |