[PATCH] x86: {reverve,free}_memtype() take a physical address

From: Rene Herman
Date: Thu Aug 21 2008 - 17:32:25 EST


The new set_memory_array_{uc,wb}() pass virtual addresses to
{reserve,free}_memtype() it seems.

Signed-off-by: Rene Herman <rene.herman@xxxxxxxxx>
---
arch/x86/mm/pageattr.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index b351c4f..d49e4db 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -947,7 +947,7 @@ int set_memory_array_uc(unsigned long *addr, int addrinarray)
* for now UC MINUS. see comments in ioremap_nocache()
*/
for (i = 0; i < addrinarray; i++) {
- if (reserve_memtype(addr[i], addr[i] + PAGE_SIZE,
+ if (reserve_memtype(__pa(addr[i]), __pa(addr[i]) + PAGE_SIZE,
_PAGE_CACHE_UC_MINUS, NULL))
goto out;
}
@@ -956,7 +956,7 @@ int set_memory_array_uc(unsigned long *addr, int addrinarray)
__pgprot(_PAGE_CACHE_UC_MINUS), 1);
out:
while (--i >= 0)
- free_memtype(addr[i], addr[i] + PAGE_SIZE);
+ free_memtype(__pa(addr[i]), __pa(addr[i]) + PAGE_SIZE);
return -EINVAL;
}
EXPORT_SYMBOL(set_memory_array_uc);
@@ -998,7 +998,7 @@ int set_memory_array_wb(unsigned long *addr, int addrinarray)
{
int i;
for (i = 0; i < addrinarray; i++)
- free_memtype(addr[i], addr[i] + PAGE_SIZE);
+ free_memtype(__pa(addr[i]), __pa(addr[i]) + PAGE_SIZE);

return change_page_attr_clear(addr, addrinarray,
__pgprot(_PAGE_CACHE_MASK), 1);
--
1.5.5


--------------050906010100090700040906--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/