|
@@ -33,17 +33,17 @@ static int is_io_mapping_possible(resource_size_t base, unsigned long size)
|
|
|
|
|
|
int iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot)
|
|
int iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot)
|
|
{
|
|
{
|
|
- unsigned long flag = _PAGE_CACHE_WC;
|
|
|
|
|
|
+ enum page_cache_mode pcm = _PAGE_CACHE_MODE_WC;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
if (!is_io_mapping_possible(base, size))
|
|
if (!is_io_mapping_possible(base, size))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
- ret = io_reserve_memtype(base, base + size, &flag);
|
|
|
|
|
|
+ ret = io_reserve_memtype(base, base + size, &pcm);
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
- *prot = __pgprot(__PAGE_KERNEL | flag);
|
|
|
|
|
|
+ *prot = __pgprot(__PAGE_KERNEL | cachemode2protval(pcm));
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(iomap_create_wc);
|
|
EXPORT_SYMBOL_GPL(iomap_create_wc);
|
|
@@ -82,8 +82,10 @@ iomap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot)
|
|
* MTRR is UC or WC. UC_MINUS gets the real intention, of the
|
|
* MTRR is UC or WC. UC_MINUS gets the real intention, of the
|
|
* user, which is "WC if the MTRR is WC, UC if you can't do that."
|
|
* user, which is "WC if the MTRR is WC, UC if you can't do that."
|
|
*/
|
|
*/
|
|
- if (!pat_enabled && pgprot_val(prot) == pgprot_val(PAGE_KERNEL_WC))
|
|
|
|
- prot = PAGE_KERNEL_UC_MINUS;
|
|
|
|
|
|
+ if (!pat_enabled && pgprot_val(prot) ==
|
|
|
|
+ (__PAGE_KERNEL | cachemode2protval(_PAGE_CACHE_MODE_WC)))
|
|
|
|
+ prot = __pgprot(__PAGE_KERNEL |
|
|
|
|
+ cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS));
|
|
|
|
|
|
return (void __force __iomem *) kmap_atomic_prot_pfn(pfn, prot);
|
|
return (void __force __iomem *) kmap_atomic_prot_pfn(pfn, prot);
|
|
}
|
|
}
|