From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 5/7] ARM: SPEAr3xx: Add device-tree support to SPEAr3xx architecture
Date: Thu, 29 Mar 2012 07:53:04 +0000 [thread overview]
Message-ID: <201203290753.04758.arnd@arndb.de> (raw)
In-Reply-To: <4F740386.2080509@st.com>
On Thursday 29 March 2012, Viresh Kumar wrote:
> But there are few concerns.
> Firstly, i wasn't aware that ioremap will reuse these mappings.
> I believed that it will create new mappings and this is what i
> saw till 2-6.37. What will happen if iounmap is called?
Yes, it was a fairly recent change. iounmap on one of these areas
will do nothing.
> Over that, board would not be using all the devices present in SoC. So,
> we don't really need to map everything. And so above wouldn't be valid
> there.
That should not really be a concern, you only waste a little bit of
the vmalloc space that you gained recently when ioremap was changed.
Nothing should ever be able to get to those pointers other than by
calling ioremap, so it doesn't hurt to have them mapped, except for
the very unlikely scenario that you get a wild pointer dereference
in the kernel that would otherwise result in an oops.
> To avoid holes, that were created in my original mappings, i can pick your
> idea of dropping IO_ADDRESS() in .virtual field and use tightly aligned
> virtual address for all peripherals.
>
> Like: UART - 4K - 0xf0000000 - 0xf0001000
> SPI - 4K - 0xf0001000 - 0xf0002000
Well, if you use the 4k mappings here, you won't benefit from reduced
TLB pressure through section maps, although you still get rid of IO_ADDRESS.
I would not put any devices into the static mapping, other than those
you need to access before mm_init() or when you can actually use the section
mapping.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Viresh Kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>
Cc: "devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org"
<devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>,
spear-devel <spear-devel-nkJGhpqTU55BDgjK7y7TUQ@public.gmane.org>,
"viresh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<viresh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"sr-ynQEQJNshbs@public.gmane.org"
<sr-ynQEQJNshbs@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH V2 5/7] ARM: SPEAr3xx: Add device-tree support to SPEAr3xx architecture
Date: Thu, 29 Mar 2012 07:53:04 +0000 [thread overview]
Message-ID: <201203290753.04758.arnd@arndb.de> (raw)
In-Reply-To: <4F740386.2080509-qxv4g6HH51o@public.gmane.org>
On Thursday 29 March 2012, Viresh Kumar wrote:
> But there are few concerns.
> Firstly, i wasn't aware that ioremap will reuse these mappings.
> I believed that it will create new mappings and this is what i
> saw till 2-6.37. What will happen if iounmap is called?
Yes, it was a fairly recent change. iounmap on one of these areas
will do nothing.
> Over that, board would not be using all the devices present in SoC. So,
> we don't really need to map everything. And so above wouldn't be valid
> there.
That should not really be a concern, you only waste a little bit of
the vmalloc space that you gained recently when ioremap was changed.
Nothing should ever be able to get to those pointers other than by
calling ioremap, so it doesn't hurt to have them mapped, except for
the very unlikely scenario that you get a wild pointer dereference
in the kernel that would otherwise result in an oops.
> To avoid holes, that were created in my original mappings, i can pick your
> idea of dropping IO_ADDRESS() in .virtual field and use tightly aligned
> virtual address for all peripherals.
>
> Like: UART - 4K - 0xf0000000 - 0xf0001000
> SPI - 4K - 0xf0001000 - 0xf0002000
Well, if you use the 4k mappings here, you won't benefit from reduced
TLB pressure through section maps, although you still get rid of IO_ADDRESS.
I would not put any devices into the static mapping, other than those
you need to access before mm_init() or when you can actually use the section
mapping.
Arnd
next prev parent reply other threads:[~2012-03-29 7:53 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-28 9:30 [PATCH V2 0/7] SPEAr DT support updates Viresh Kumar
2012-03-28 9:30 ` Viresh Kumar
2012-03-28 9:30 ` [PATCH V2 1/7] SPEAr: Use CLKDEV_INIT for defining clk_lookups Viresh Kumar
2012-03-28 9:30 ` Viresh Kumar
2012-03-28 9:30 ` [PATCH V2 2/7] SPEAr3xx: Add clock instance of usb hosts - ehci and ohci 0 and 1 Viresh Kumar
2012-03-28 9:30 ` Viresh Kumar
2012-03-28 9:30 ` [PATCH V2 3/7] SPEAr6xx: Add compilation support for dtbs using 'make dtbs' Viresh Kumar
2012-03-28 9:30 ` Viresh Kumar
2012-03-28 9:41 ` [PATCH V2 4/7] SPEAr3xx: Replace printk() with pr_*() Viresh Kumar
2012-03-28 9:41 ` Viresh Kumar
2012-03-28 9:41 ` [PATCH V2 5/7] ARM: SPEAr3xx: Add device-tree support to SPEAr3xx architecture Viresh Kumar
2012-03-28 9:41 ` Viresh Kumar
2012-03-28 12:27 ` Arnd Bergmann
2012-03-28 12:27 ` Arnd Bergmann
2012-03-29 6:39 ` Viresh Kumar
2012-03-29 6:39 ` Viresh Kumar
2012-03-29 7:53 ` Arnd Bergmann [this message]
2012-03-29 7:53 ` Arnd Bergmann
2012-03-29 10:44 ` Viresh Kumar
2012-03-29 10:44 ` Viresh Kumar
2012-03-28 9:41 ` [PATCH V2 6/7] SPEAr: Add PL080 DMA support for 3xx and 6xx Viresh Kumar
2012-03-28 9:41 ` Viresh Kumar
2012-03-28 9:41 ` [PATCH V2 7/7] SPEAr: Update defconfigs Viresh Kumar
2012-03-28 9:41 ` Viresh Kumar
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=201203290753.04758.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.