Skip to contentSkip to conversation

OpenRISC: BUG: failure at mm/page_alloc.c:2467/free_pages()!

DISCUSSION Richard Weinberger 2 participants 2 messages Mar 2, 2012 Openrisc architecture

lore
Share & tools
lore
#0 lore raw

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.

Thanks,
//richard

maintainer
#1 lore raw
Quoted 6 lines · Richard Weinberger

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:

(quoted diff) +0 -0

b/arch/openrisc/include/asm/page.h
index b041b34..c4ffaee 100644

arch/openrisc/include/asm/page.h +0 -1
@@ -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__ */