All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Timur Tabi <timur@freescale.com>
Cc: Dan Malek <ppc6dev@digitaldans.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: minimum guaranteed alignment of dma_alloc_coherent?
Date: Tue, 29 Mar 2011 11:32:39 +1100	[thread overview]
Message-ID: <1301358759.2402.665.camel@pasglop> (raw)
In-Reply-To: <4D500C28.7000704@freescale.com>

On Mon, 2011-02-07 at 09:13 -0600, Timur Tabi wrote:
> > This behavior is modified if you specify a restricted DMA
> > mask for the device.  In this case, dma_alloc_coherent
> > will force GFP_DMA on your behalf (on PowerPC).
> 
> Isn't it required for all callers of dma_alloc_coherent to specify a
> mask (via
> dma_set_mask) first?

GFP_DMA historically means ISA DMA memory on x86 :-) Other platforms had
different "use" for it but basically it's old style drivers.

The problem with dma_set_mask() is that there's no way without an iommu
that the implementation of dma_alloc_coherent() can satisfy arbitrary
masks since you don't control where the page allocator gets you the
pages from ... unless you have zones. That's what ZONE_DMA and
ZONE_DMA32 are for.

Cheers,
Ben.

      reply	other threads:[~2011-03-29  0:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-05  0:14 minimum guaranteed alignment of dma_alloc_coherent? Timur Tabi
2011-02-05  1:09 ` Dan Malek
2011-02-05  2:04   ` Tabi Timur-B04825
2011-02-05  2:56     ` Dan Malek
2011-02-07 15:13       ` Timur Tabi
2011-03-29  0:32         ` Benjamin Herrenschmidt [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=1301358759.2402.665.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ppc6dev@digitaldans.com \
    --cc=timur@freescale.com \
    /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.