linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC][PATCH] arm64: Add atomic pool for dma mapping
Date: Tue, 22 Apr 2014 11:02:01 +0100	[thread overview]
Message-ID: <20140422100201.GB7484@arm.com> (raw)
In-Reply-To: <1397764941-1351-1-git-send-email-lauraa@codeaurora.org>

Hi Laura,

On Thu, Apr 17, 2014 at 09:02:21PM +0100, Laura Abbott wrote:
> Neither CMA nor noncoherent allocations support atomic allocations.
> Add a dedicated atomic pool to support this.
> 
> Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
> ---
>  arch/arm64/mm/dma-mapping.c | 186 +++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 184 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
> index 0ba347e..c67a3ff 100644
> --- a/arch/arm64/mm/dma-mapping.c
> +++ b/arch/arm64/mm/dma-mapping.c
> @@ -38,6 +38,110 @@ static pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot,
>  	return prot;
>  }
>  
> +#define DEFAULT_DMA_COHERENT_POOL_SIZE  SZ_256K
> +
> +struct dma_pool {
> +	size_t size;
> +	spinlock_t lock;
> +	void *coherent_vaddr;
> +	void *noncoherent_vaddr;
> +	unsigned long *bitmap;
> +	unsigned long nr_pages;
> +	struct page **pages;
> +};
> +
> +static struct dma_pool atomic_pool = {
> +	.size = DEFAULT_DMA_COHERENT_POOL_SIZE,
> +};
> +
> +static int __init early_coherent_pool(char *p)
> +{
> +	atomic_pool.size = memparse(p, &p);
> +	return 0;
> +}
> +early_param("coherent_pool", early_coherent_pool);

What happened to the device-tree bindings we discussed in Edinburgh with
Grant and Ben? This looks like a good opportunity to make use of those,
rather than use the command-line as we do for arch/arm.

Will

  reply	other threads:[~2014-04-22 10:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17 20:02 [RFC][PATCH] arm64: Add atomic pool for dma mapping Laura Abbott
2014-04-22 10:02 ` Will Deacon [this message]
2014-04-22 22:50   ` Laura Abbott
2014-05-30  2:38 ` David Riley
2014-05-31 21:42   ` Laura Abbott

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=20140422100201.GB7484@arm.com \
    --to=will.deacon@arm.com \
    --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).