public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas@southpole.se>
To: Richard Weinberger <richard@nod.at>
Cc: linux@openrisc.net,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: OpenRISC: BUG: failure at mm/page_alloc.c:2467/free_pages()!
Date: Fri, 02 Mar 2012 07:36:32 +0100	[thread overview]
Message-ID: <1330670192.19557.96.camel@satguru> (raw)
In-Reply-To: <4F501E60.3090701@nod.at>

[-- Attachment #1: Type: text/plain, Size: 919 bytes --]

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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

      reply	other threads:[~2012-03-02  6:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02  1:12 OpenRISC: BUG: failure at mm/page_alloc.c:2467/free_pages()! Richard Weinberger
2012-03-02  6:36 ` Jonas Bonn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330670192.19557.96.camel@satguru \
    --to=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@openrisc.net \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox