x86: ioremap remove the range check of cpa
Now that cpa works on non-direct mappings as well, we can safely remove the range check in ioremap_change_attr(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
e66aadbe6c
commit
75ab43bfce
@@ -70,25 +70,12 @@ int page_is_ram(unsigned long pagenr)
|
|||||||
* Fix up the linear direct mapping of the kernel to avoid cache attribute
|
* Fix up the linear direct mapping of the kernel to avoid cache attribute
|
||||||
* conflicts.
|
* conflicts.
|
||||||
*/
|
*/
|
||||||
static int ioremap_change_attr(unsigned long paddr, unsigned long size,
|
static int ioremap_change_attr(unsigned long vaddr, unsigned long size,
|
||||||
enum ioremap_mode mode)
|
enum ioremap_mode mode)
|
||||||
{
|
{
|
||||||
unsigned long vaddr = (unsigned long)__va(paddr);
|
|
||||||
unsigned long nrpages = size >> PAGE_SHIFT;
|
unsigned long nrpages = size >> PAGE_SHIFT;
|
||||||
unsigned int level;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
/* No change for pages after the last mapping */
|
|
||||||
if ((paddr + size - 1) >= (max_pfn_mapped << PAGE_SHIFT))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If there is no identity map for this address,
|
|
||||||
* change_page_attr_addr is unnecessary
|
|
||||||
*/
|
|
||||||
if (!lookup_address(vaddr, &level))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case IOR_MODE_UNCACHED:
|
case IOR_MODE_UNCACHED:
|
||||||
default:
|
default:
|
||||||
@@ -169,7 +156,7 @@ static void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ioremap_change_attr(phys_addr, size, mode) < 0) {
|
if (ioremap_change_attr(vaddr, size, mode) < 0) {
|
||||||
vunmap(area->addr);
|
vunmap(area->addr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user