From: Mark Salter <msalter@redhat.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <Will.Deacon@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arm64: allow ioremap_cache() to use existing RAM mappings
Date: Wed, 23 Oct 2013 09:46:12 -0400 [thread overview]
Message-ID: <1382535972.1768.68.camel@deneb.redhat.com> (raw)
In-Reply-To: <1382519898.10408.1.camel@mbp>
On Wed, 2013-10-23 at 10:18 +0100, Catalin Marinas wrote:
> On Mon, 2013-10-21 at 14:36 +0100, msalter@redhat.com wrote:
> > diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c
> > index 1725cd6..fb44b3d 100644
> > --- a/arch/arm64/mm/ioremap.c
> > +++ b/arch/arm64/mm/ioremap.c
> > @@ -79,6 +79,21 @@ void __iounmap(volatile void __iomem *io_addr)
> > {
> > void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
> >
> > + /* Nothing to do for normal memory. See ioremap_cache() */
> > + if (pfn_valid(__virt_to_phys(addr) >> PAGE_SHIFT))
> > + return;
>
> addr here can be some I/O address mapped previously, so __virt_to_phys()
> is not valid (you don't actually get the pfn by shifting).
>
Yeah, that's ugly. The thought was that only the kernel mapping of RAM
would yield a valid address from __virt_to_phys(). Anything else, like
a mapping of I/O space would lead to an invalid PFN. There's probably a
clearer way of doing that that. Other than that, is the general concept
of the patch reasonable?
--Mark
next prev parent reply other threads:[~2013-10-23 13:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-21 13:36 [PATCH] arm64: allow ioremap_cache() to use existing RAM mappings Mark Salter
2013-10-23 9:18 ` Catalin Marinas
2013-10-23 13:46 ` Mark Salter [this message]
2013-10-23 14:37 ` Catalin Marinas
2013-10-24 14:54 ` [PATCH v2] " Mark Salter
2013-10-29 16:41 ` Catalin Marinas
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=1382535972.1768.68.camel@deneb.redhat.com \
--to=msalter@redhat.com \
--cc=Will.Deacon@arm.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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