From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM"
Date: Tue, 10 Aug 2010 17:36:16 +0100 [thread overview]
Message-ID: <20100810163616.GA7702@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4C615D0D.2080600@st.com>
On Tue, Aug 10, 2010 at 03:07:09PM +0100, Stuart Menefy wrote:
> Doesn't dma_alloc_coherent() suffer from the same problems? Pages are
> allocated using alloc_pages, and in the non-coherent case will be
> mapped uncached into consistent mapping region, creating a second
> mapping with different attributes.
Yes, and it's just waiting to corrupt your data. It's the next item on
the list of things to fix for ARMv6/ARMv7 for the next merge window.
This merge window contains a small step in that direction by changing
the way the DMA region allocator works - aligning allocations to their
natural size.
Potentially, that means people may need a larger DMA region - there
will be allocation patterns which fail (eg, 1.5MB, 256MB, 16MB, 240MB)
which used to succeed - though problems due to fragmentation should
be reduced due to the natural alignment of blocks below 1MB.
There are two solutions I'm contemplating:
1. We pre-allocate the memory for the DMA region at boot and never free
it for other uses. This means that the DMA coherent region will
always be fully populated regardless of how much memory is actually
in use.
2. We allocate memory for the DMA region in sections, and unmap that
memory from the lowmem pool.
(1) has the problem that people won't like it due to the obvious waste,
but it is the easy solution.
(2) is rather disgusting to achieve because of the problems of updating
all page tables in the system, especially on SMP systems.
The option of doing nothing is not realistic - as ARM processors progress,
the speculative prefetch benaviour is only going to become more aggressive,
and therefore memory which is mapped multiple times with different
attributes _will_ fail to behave as expected in random and hard to debug
ways.
next prev parent reply other threads:[~2010-08-10 16:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-08 15:45 [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Arnd Hannemann
2010-08-08 22:00 ` Russell King - ARM Linux
2010-08-10 14:07 ` Stuart Menefy
2010-08-10 16:36 ` Russell King - ARM Linux [this message]
2010-08-10 8:45 ` Philippe Rétornaz
2010-08-10 9:27 ` Russell King - ARM Linux
2010-08-10 19:55 ` Guennadi Liakhovetski
2010-08-10 21:26 ` Russell King - ARM Linux
2010-08-13 10:52 ` hisao munakata
2010-08-18 19:23 ` Guennadi Liakhovetski
2010-08-18 19:41 ` Russell King - ARM Linux
2010-08-18 20:31 ` Guennadi Liakhovetski
2010-08-18 21:44 ` Russell King - ARM Linux
2010-08-18 21:47 ` Russell King - ARM Linux
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=20100810163616.GA7702@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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 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).