On Sun, Aug 19, 2018 at 07:38:44PM +0200, Mark Kettenis wrote: > If memory is supposed to be cached, we should make it so. Matches > what the Linux version of this code does. > > ok?
Sure, I had something similiar in a tree here. Could you keep the comment in the original code as well? Index: ttm_bo_util.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/ttm/ttm_bo_util.c,v retrieving revision 1.19 diff -u -p -r1.19 ttm_bo_util.c --- ttm_bo_util.c 25 Apr 2018 01:27:46 -0000 1.19 +++ ttm_bo_util.c 20 Aug 2018 01:32:45 -0000 @@ -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;