From: Russell King <rmk+lkml@arm.linux.org.uk>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Pavel Machek <pavel@ucw.cz>,
rpurdie@rpsys.net, lenz@cs.wisc.edu,
linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: include/asm-arm/memory.h changes break zaurus sl-5500 boot
Date: Mon, 3 Apr 2006 08:36:53 +0100 [thread overview]
Message-ID: <20060403073653.GA13275@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20060403091504.ecd341a3.kamezawa.hiroyu@jp.fujitsu.com>
On Mon, Apr 03, 2006 at 09:15:04AM +0900, KAMEZAWA Hiroyuki wrote:
> On Mon, 3 Apr 2006 00:23:14 +0200
> Pavel Machek <pavel@ucw.cz> wrote:
> > > Not surprising given this gem:
> > >
> > > > -#define arch_local_page_offset(pfn, nid) (LOCAL_MAP_NR((pfn) << PAGE_OFFSET))
> > >
> > > PAGE_OFFSET being 3GB - that's one hell of a shift value!
> >
> > Unfortunately this is mainline now. Is there some better fix than
> > simply reverting the offending patches?
>
> Maybe this one will fix (against 2.6.16-mm2)
>
> LOCAL_MAP_NR(kaddr) returns page offset in a node.
LOCAL_MAP_NR does not take a kernel virtual address. If you look at how
it's defined (Eg):
#define LOCAL_MAP_NR(addr) \
(((unsigned long)(addr) & 0x07ffffff) >> PAGE_SHIFT)
then you will notice that it's actually converting an offset into a node
into an index. This means that converting a PFN to a virtual address is
just a complete and utter waste of time.
So:
> -#define arch_local_page_offset(pfn, nid) (LOCAL_MAP_NR((pfn) << PAGE_OFFSET))
> +#define arch_local_page_offset(pfn, nid) (LOCAL_MAP_NR(__va((pfn) << PAGE_SHIFT)))
this should be:
#define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT)
Please also avoid the over-use of parens. It's a disease which just makes
things harder to read (eg, the have I got enough close parens at the end
of the line to balance.)
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2006-04-03 7:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-02 21:00 Pavel Machek
2006-04-02 22:08 ` Russell King
2006-04-02 22:23 ` Pavel Machek
2006-04-02 23:53 ` KAMEZAWA Hiroyuki
2006-04-03 0:15 ` KAMEZAWA Hiroyuki
2006-04-03 7:36 ` Russell King [this message]
2006-04-03 7:44 ` KAMEZAWA Hiroyuki
2006-04-03 8:56 ` KAMEZAWA Hiroyuki
2006-04-03 9:02 ` Russell King
2006-04-03 9:08 ` KAMEZAWA Hiroyuki
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=20060403073653.GA13275@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=akpm@osdl.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=lenz@cs.wisc.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rpurdie@rpsys.net \
/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
Powered by JetHome