On Fri, 2012-03-02 at 02:12 +0100, Richard Weinberger wrote:
> Hi!
> 
> CONFIG_DEBUG_VM exposes this splat:
> BUG: failure at mm/page_alloc.c:2467/free_pages()!
> 
> addr is 0xc100c000, but memory_end is 0x02000000.

virt_addr_valid() is broken (asm/page.h) as it's trying to compare to a
phys_addr_t.

Something like the following looks better:

diff --git a/arch/openrisc/include/asm/page.h
b/arch/openrisc/include/asm/page.h
index b041b34..c4ffaee 100644
--- a/arch/openrisc/include/asm/page.h
+++ b/arch/openrisc/include/asm/page.h
@@ -94,8 +94,7 @@ extern unsigned long memory_end;
 
 #define pfn_valid(pfn)          ((pfn) < max_mapnr)
 
-#define virt_addr_valid(kaddr)  (((void *)(kaddr) >= (void
*)PAGE_OFFSET) && \
-                               ((void *)(kaddr) < (void *)memory_end))
+#define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr)))
 
 #endif /* __ASSEMBLY__ */

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Linux mailing list
[email protected]
http://lists.openrisc.net/listinfo/linux

Reply via email to