From: Rob Herring <robherring2@gmail.com>
To: Richard Lee <superlibj8301@gmail.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Arnd Bergmann <arnd@arndb.de>,
Laura Abbott <lauraa@codeaurora.org>,
Andrew Morton <akpm@linux-foundation.org>,
d.hatayama@jp.fujitsu.com, zhangyanfei@cn.fujitsu.com,
liwanp@linux.vnet.ibm.com, iamjoonsoo.kim@lge.com,
hannes@cmpxchg.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Nicolas Pitre <nico@fluxnic.net>
Subject: Re: [PATCHv2 1/2] mm/vmalloc: Add IO mapping space reused interface support.
Date: Wed, 14 May 2014 11:06:57 -0500 [thread overview]
Message-ID: <CAL_JsqLncBaJ=uceovX80U1JPU8SW3KWKXW3PiVR8Kbnykcvpg@mail.gmail.com> (raw)
In-Reply-To: <1400055532-13134-2-git-send-email-superlibj8301@gmail.com>
Adding Nico...
On Wed, May 14, 2014 at 3:18 AM, Richard Lee <superlibj8301@gmail.com> wrote:
> For the IO mapping, the same physical address space maybe
> mapped more than one time, for example, in some SoCs:
> - 0x20001000 ~ 0x20001400 --> 1KB for Dev1
> - 0x20001400 ~ 0x20001800 --> 1KB for Dev2
> and the page size is 4KB.
>
> Then both Dev1 and Dev2 will do ioremap operations, and the IO
> vmalloc area's virtual address will be aligned down to 4KB, and
> the size will be aligned up to 4KB. That's to say, only one
> 4KB size's vmalloc area could contain Dev1 and Dev2 IO mapping area
> at the same time.
>
> For this case, we can ioremap only one time, and the later ioremap
> operation will just return the exist vmalloc area.
We already have similar reuse tracking for the static mappings on ARM.
I'm wondering if either that can be reused for ioremap as well or this
can replace the static mapping tracking. It seems silly to have 2
lists to search for finding an existing mapping.
But there is a fundamental problem with your approach. You do not and
cannot check the memory type of the mapping. If you look at the static
mapping code, it only reuses mappings if the memory type match. While
having aliases with different memory types is bad on ARMv6+, I assume
there are some cases that do that given the static mapping code
handles that case. We would at least want to detect and warn if we
didn't want to allow different attributes rather than just return a
mapping with whatever attributes the first mapping used.
Rob
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-05-14 16:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-14 8:18 [PATCHv2 0/2] Add IO mapping space reused support Richard Lee
2014-05-14 8:18 ` [PATCHv2 1/2] mm/vmalloc: Add IO mapping space reused interface support Richard Lee
2014-05-14 16:06 ` Rob Herring [this message]
2014-05-15 3:46 ` Richard Lee
2014-05-14 22:56 ` Andrew Morton
2014-05-15 7:55 ` Richard Lee
2014-05-14 8:18 ` [PATCHv2 2/2] ARM: ioremap: Add IO mapping space reused support Richard Lee
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='CAL_JsqLncBaJ=uceovX80U1JPU8SW3KWKXW3PiVR8Kbnykcvpg@mail.gmail.com' \
--to=robherring2@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=d.hatayama@jp.fujitsu.com \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=lauraa@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@arm.linux.org.uk \
--cc=liwanp@linux.vnet.ibm.com \
--cc=nico@fluxnic.net \
--cc=superlibj8301@gmail.com \
--cc=zhangyanfei@cn.fujitsu.com \
/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;
as well as URLs for NNTP newsgroup(s).