From: "Anders Grafström" <grfstrm@users.sourceforge.net>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC] ARM: DMA coherent allocator: align remapped addresses
Date: Wed, 22 Sep 2010 16:49:22 +0200 [thread overview]
Message-ID: <4C9A1772.4000502@users.sourceforge.net> (raw)
In-Reply-To: <20100725135024.GA6609@n2100.arm.linux.org.uk>
On 2010-07-25 15:50, Russell King - ARM Linux wrote:
> + * Align the virtual region allocation - maximum alignment is
> + * a section size, minimum is a page size. This helps reduce
> + * fragmentation of the DMA space, and also prevents allocations
> + * smaller than a section from crossing a section boundary.
> + */
> + bit = fls(size - 1) + 1;
> + if (bit > SECTION_SHIFT)
> + bit = SECTION_SHIFT;
> + align = 1 << bit;
A size of 4096 results in an alignment of 8192. Is that really intended?
ixp4xx seems to run out of vmregion due to this. The patch below makes it work again.
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 4bc43e5..7012105 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -198,7 +198,7 @@ __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot)
* fragmentation of the DMA space, and also prevents allocations
* smaller than a section from crossing a section boundary.
*/
- bit = fls(size - 1) + 1;
+ bit = fls(size - 1);
if (bit > SECTION_SHIFT)
bit = SECTION_SHIFT;
align = 1 << bit;
prev parent reply other threads:[~2010-09-22 14:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-25 13:50 [RFC] ARM: DMA coherent allocator: align remapped addresses Russell King - ARM Linux
2010-09-22 14:49 ` Anders Grafström [this message]
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=4C9A1772.4000502@users.sourceforge.net \
--to=grfstrm@users.sourceforge.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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).