Let io_mapping_init_wc() fall back to an uncacheable mapping.

This allows usage of the function on architectures that don't support
write-combining.

Reported by:	bz, emaste
X-MFC With:	r320196
This commit is contained in:
Mark Johnston 2017-07-03 02:01:16 +00:00
parent 85823a601c
commit 4600d349be
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320580

View File

@ -53,8 +53,13 @@ io_mapping_init_wc(struct io_mapping *mapping, resource_size_t base,
mapping->base = base;
mapping->size = size;
#ifdef VM_MEMATTR_WRITE_COMBINING
mapping->mem = ioremap_wc(base, size);
mapping->attr = VM_MEMATTR_WRITE_COMBINING;
#else
mapping->mem = ioremap_nocache(base, size);
mapping->attr = VM_MEMATTR_UNCACHEABLE;
#endif
return (mapping);
}