From: lauraa@codeaurora.org (Laura Abbott)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 2/2] arm64: Enable CMA
Date: Tue, 10 Dec 2013 13:06:39 -0800 [thread overview]
Message-ID: <52A7825F.50306@codeaurora.org> (raw)
In-Reply-To: <1386705132-7127-3-git-send-email-lauraa@codeaurora.org>
On 12/10/2013 11:52 AM, Laura Abbott wrote:
>
> @@ -36,14 +37,33 @@ static void *arm64_swiotlb_alloc_coherent(struct device *dev, size_t size,
> if (dev && IS_ENABLED(CONFIG_ZONE_DMA32) &&
> dev->coherent_dma_mask <= DMA_BIT_MASK(32))
> flags |= GFP_DMA32;
> - return swiotlb_alloc_coherent(dev, size, dma_handle, flags);
> + if (IS_ENABLED(CONFIG_DMA_CMA)) {
> + struct page *page;
> +
> + page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT,
> + get_order(size));
> + if (!page)
> + return NULL;
> +
> + return page_address(page);
> + } else {
> + return swiotlb_alloc_coherent(dev, size, dma_handle, flags);
> + }
> }
Whoops I manged to send out the incorrect version here where I never set
the dma_handle. Let me resend again...
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
prev parent reply other threads:[~2013-12-10 21:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-10 19:52 [PATCHv2 0/2] CMA for arm64 Laura Abbott
2013-12-10 19:52 ` [PATCHv2 1/2] arm64: Check for NULL device before getting the coherent_dma_mask Laura Abbott
2013-12-10 19:52 ` [PATCHv2 2/2] arm64: Enable CMA Laura Abbott
2013-12-10 21:06 ` Laura Abbott [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=52A7825F.50306@codeaurora.org \
--to=lauraa@codeaurora.org \
--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).