diff options
author | Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> | 2009-07-10 12:57:33 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-08-26 18:41:07 -0400 |
commit | 279e669b3fc0068cc3509e8e53036999e1e86588 (patch) | |
tree | 58b1dc1836b2c138ad765579ad202b25e00036d8 | |
parent | 5fc517466dd3d0fc6d2a5180ca6792e60344d8be (diff) |
x86, pat: ioremap to follow same PAT restrictions as other PAT users
ioremap has this hard-coded check for new type and requested type. That
check differs from other PAT users like /dev/mem mmap, remap_pfn_range
in only one condition where requested type is UC_MINUS and new type
is WC. Under that condition, ioremap fails. But other PAT interfaces succeed
with a WC mapping.
Change to make ioremap be in sync with other PAT APIs and use the same
macro as others. Also changes the error print to KERN_ERR instead of
pr_debug.
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | arch/x86/mm/ioremap.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 8a450930834f..aeaea8c5b2f4 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -228,24 +228,13 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, | |||
228 | retval = reserve_memtype(phys_addr, (u64)phys_addr + size, | 228 | retval = reserve_memtype(phys_addr, (u64)phys_addr + size, |
229 | prot_val, &new_prot_val); | 229 | prot_val, &new_prot_val); |
230 | if (retval) { | 230 | if (retval) { |
231 | pr_debug("Warning: reserve_memtype returned %d\n", retval); | 231 | printk(KERN_ERR "ioremap reserve_memtype failed %d\n", retval); |
232 | return NULL; | 232 | return NULL; |
233 | } | 233 | } |
234 | 234 | ||
235 | if (prot_val != new_prot_val) { | 235 | if (prot_val != new_prot_val) { |
236 | /* | 236 | if (!is_new_memtype_allowed(prot_val, new_prot_val)) { |
237 | * Do not fallback to certain memory types with certain | 237 | printk(KERN_ERR |
238 | * requested type: | ||
239 | * - request is uc-, return cannot be write-back | ||
240 | * - request is uc-, return cannot be write-combine | ||
241 | * - request is write-combine, return cannot be write-back | ||
242 | */ | ||
243 | if ((prot_val == _PAGE_CACHE_UC_MINUS && | ||
244 | (new_prot_val == _PAGE_CACHE_WB || | ||
245 | new_prot_val == _PAGE_CACHE_WC)) || | ||
246 | (prot_val == _PAGE_CACHE_WC && | ||
247 | new_prot_val == _PAGE_CACHE_WB)) { | ||
248 | pr_debug( | ||
249 | "ioremap error for 0x%llx-0x%llx, requested 0x%lx, got 0x%lx\n", | 238 | "ioremap error for 0x%llx-0x%llx, requested 0x%lx, got 0x%lx\n", |
250 | (unsigned long long)phys_addr, | 239 | (unsigned long long)phys_addr, |
251 | (unsigned long long)(phys_addr + size), | 240 | (unsigned long long)(phys_addr + size), |